Skip to content

Commit d93f456

Browse files
committed
day 32 demo
1 parent e9059c8 commit d93f456

File tree

18 files changed

+2591
-49
lines changed

18 files changed

+2591
-49
lines changed

class-32/BuyCheapStuff/.gitignore

+26-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
1-
*.iml
2-
.gradle
3-
/local.properties
4-
/.idea/caches
5-
/.idea/libraries
6-
/.idea/modules.xml
7-
/.idea/workspace.xml
8-
/.idea/navEditor.xml
9-
/.idea/assetWizardSettings.xml
10-
.DS_Store
11-
/build
12-
/captures
13-
.externalNativeBuild
14-
.cxx
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
16+
#amplify
17+
amplify/\#current-cloud-backend
18+
amplify/.config/local-*
19+
amplify/mock-data
20+
amplify/backend/amplify-meta.json
21+
amplify/backend/awscloudformation
22+
build/
23+
dist/
24+
node_modules/
25+
aws-exports.js
26+
awsconfiguration.json
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
projects:
2+
buycheapstuff2:
3+
schemaPath: app/src/main/graphql/schema.json
4+
includes:
5+
- app/src/main/graphql/**/*.graphql
6+
excludes:
7+
- ./amplify/**
8+
extensions:
9+
amplify:
10+
codeGenTarget: ''
11+
generatedFileName: ''
12+
docsFilePath: app/src/main/graphql/com/amazonaws/amplify/generated/graphql
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"projectName": "BuyCheapStuff",
3+
"version": "2.0",
4+
"frontend": "android",
5+
"android": {
6+
"config": {
7+
"ResDir": "app/src/main/res"
8+
}
9+
},
10+
"providers": [
11+
"awscloudformation"
12+
]
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"AppSyncApiName": "buycheapstuff2",
3+
"DynamoDBBillingMode": "PAY_PER_REQUEST",
4+
"DynamoDBEnableServerSideEncryption": "false"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type BuyableItem @model {
2+
id: ID!
3+
title: String!
4+
priceInCents: Int!
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"AWSTemplateFormatVersion": "2010-09-09",
3+
"Description": "An auto-generated nested stack.",
4+
"Metadata": {},
5+
"Parameters": {
6+
"AppSyncApiId": {
7+
"Type": "String",
8+
"Description": "The id of the AppSync API associated with this project."
9+
},
10+
"AppSyncApiName": {
11+
"Type": "String",
12+
"Description": "The name of the AppSync API",
13+
"Default": "AppSyncSimpleTransform"
14+
},
15+
"env": {
16+
"Type": "String",
17+
"Description": "The environment name. e.g. Dev, Test, or Production",
18+
"Default": "NONE"
19+
},
20+
"S3DeploymentBucket": {
21+
"Type": "String",
22+
"Description": "The S3 bucket containing all deployment assets for the project."
23+
},
24+
"S3DeploymentRootKey": {
25+
"Type": "String",
26+
"Description": "An S3 key relative to the S3DeploymentBucket that points to the root\nof the deployment directory."
27+
}
28+
},
29+
"Resources": {
30+
"EmptyResource": {
31+
"Type": "Custom::EmptyResource",
32+
"Condition": "AlwaysFalse"
33+
}
34+
},
35+
"Conditions": {
36+
"HasEnvironmentParameter": {
37+
"Fn::Not": [
38+
{
39+
"Fn::Equals": [
40+
{
41+
"Ref": "env"
42+
},
43+
"NONE"
44+
]
45+
}
46+
]
47+
},
48+
"AlwaysFalse": {
49+
"Fn::Equals": [
50+
"true",
51+
"false"
52+
]
53+
}
54+
},
55+
"Outputs": {
56+
"EmptyOutput": {
57+
"Description": "An empty output. You may delete this if you have at least one resource above.",
58+
"Value": ""
59+
}
60+
}
61+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"Version": 4
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"api": {
3+
"buycheapstuff2": {
4+
"service": "AppSync",
5+
"providerPlugin": "awscloudformation",
6+
"output": {
7+
"authConfig": {
8+
"additionalAuthenticationProviders": [],
9+
"defaultAuthentication": {
10+
"authenticationType": "API_KEY",
11+
"apiKeyConfig": {
12+
"description": "buycheapstuff2apikey",
13+
"apiKeyExpirationDays": "365"
14+
}
15+
}
16+
}
17+
}
18+
}
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"local": {
3+
"awscloudformation": {
4+
"AuthRoleName": "amplify-buycheapstuff-local-153108-authRole",
5+
"UnauthRoleArn": "arn:aws:iam::743080406423:role/amplify-buycheapstuff-local-153108-unauthRole",
6+
"AuthRoleArn": "arn:aws:iam::743080406423:role/amplify-buycheapstuff-local-153108-authRole",
7+
"Region": "us-west-2",
8+
"DeploymentBucketName": "amplify-buycheapstuff-local-153108-deployment",
9+
"UnauthRoleName": "amplify-buycheapstuff-local-153108-unauthRole",
10+
"StackName": "amplify-buycheapstuff-local-153108",
11+
"StackId": "arn:aws:cloudformation:us-west-2:743080406423:stack/amplify-buycheapstuff-local-153108/cd760710-fa9b-11e9-9d46-0294f1fd1ce8"
12+
}
13+
}
14+
}

class-32/BuyCheapStuff/app/build.gradle

+9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@ android {
1919
}
2020
}
2121

22+
apply plugin: 'com.amazonaws.appsync'
23+
2224
dependencies {
25+
//Base SDK
26+
implementation 'com.amazonaws:aws-android-sdk-core:2.15.+'
27+
//AppSync SDK
28+
implementation 'com.amazonaws:aws-android-sdk-appsync:2.8.+'
29+
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0'
30+
implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
31+
2332
implementation fileTree(dir: 'libs', include: ['*.jar'])
2433
implementation 'androidx.appcompat:appcompat:1.0.2'
2534
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# this is an auto generated file. This will be overwritten
2+
mutation CreateBuyableItem($input: CreateBuyableItemInput!) {
3+
createBuyableItem(input: $input) {
4+
id
5+
title
6+
priceInCents
7+
}
8+
}
9+
mutation UpdateBuyableItem($input: UpdateBuyableItemInput!) {
10+
updateBuyableItem(input: $input) {
11+
id
12+
title
13+
priceInCents
14+
}
15+
}
16+
mutation DeleteBuyableItem($input: DeleteBuyableItemInput!) {
17+
deleteBuyableItem(input: $input) {
18+
id
19+
title
20+
priceInCents
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# this is an auto generated file. This will be overwritten
2+
query GetBuyableItem($id: ID!) {
3+
getBuyableItem(id: $id) {
4+
id
5+
title
6+
priceInCents
7+
}
8+
}
9+
query ListBuyableItems(
10+
$filter: ModelBuyableItemFilterInput
11+
$limit: Int
12+
$nextToken: String
13+
) {
14+
listBuyableItems(filter: $filter, limit: $limit, nextToken: $nextToken) {
15+
items {
16+
id
17+
title
18+
priceInCents
19+
}
20+
nextToken
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# this is an auto generated file. This will be overwritten
2+
subscription OnCreateBuyableItem {
3+
onCreateBuyableItem {
4+
id
5+
title
6+
priceInCents
7+
}
8+
}
9+
subscription OnUpdateBuyableItem {
10+
onUpdateBuyableItem {
11+
id
12+
title
13+
priceInCents
14+
}
15+
}
16+
subscription OnDeleteBuyableItem {
17+
onDeleteBuyableItem {
18+
id
19+
title
20+
priceInCents
21+
}
22+
}

0 commit comments

Comments
 (0)