Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,4 @@ amplify-gradle-config.json
amplifytools.xcconfig
.secret-*
**.sample
#amplify-do-not-edit-end

#amplify-do-not-edit-begin
amplify/\#current-cloud-backend
amplify/.config/local-*
amplify/logs
amplify/mock-data
amplify/backend/amplify-meta.json
amplify/backend/.temp
build/
dist/
node_modules/
aws-exports.js
awsconfiguration.json
amplifyconfiguration.json
amplifyconfiguration.dart
amplify-build-config.json
amplify-gradle-config.json
amplifytools.xcconfig
.secret-*
**.sample
#amplify-do-not-edit-end
#amplify-do-not-edit-end
12 changes: 6 additions & 6 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions amplify/backend/api/thrifty2/cli-inputs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"version": 1,
"serviceConfiguration": {
"serviceName": "AppSync",
"defaultAuthType": {
"mode": "AMAZON_COGNITO_USER_POOLS",
"cognitoUserPoolId": "auththrifty23c488d7e"
},
"conflictResolution": {
"defaultResolutionStrategy": {
"type": "AUTOMERGE"
}
},
"apiName": "thrifty2",
"gqlSchemaPath": "/tmp/amplify-5f5ada2c-a6db-4c8f-a135-c722a7a816d9/amplify/backend/api/thrifty2/schema.graphql",
"additionalAuthTypes": [
{
"mode": "API_KEY",
"keyDescription": "api key description",
"expirationTime": 30
},
{
"mode": "AWS_IAM"
}
]
}
}
3 changes: 2 additions & 1 deletion amplify/backend/api/thrifty2/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"auththrifty23c488d7e",
"Outputs.UserPoolId"
]
}
},
"AuthModeLastUpdated": "2021-12-01T23:40:42.562Z"
}
1 change: 1 addition & 0 deletions amplify/backend/api/thrifty2/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ type Product @model @auth(rules: [{allow: private}]) @key(name: "byCategory", fi
categoryID: ID
image: String!
}

13 changes: 12 additions & 1 deletion amplify/backend/backend-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,18 @@
"userPoolId": "auththrifty23c488d7e"
}
},
"additionalAuthenticationProviders": []
"additionalAuthenticationProviders": [
{
"authenticationType": "API_KEY",
"apiKeyConfig": {
"apiKeyExpirationDays": 30,
"description": "api key description"
}
},
{
"authenticationType": "AWS_IAM"
}
]
}
}
}
Expand Down
90 changes: 45 additions & 45 deletions amplify/cli.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
{
"features": {
"graphqltransformer": {
"addmissingownerfields": true,
"improvepluralization": false,
"validatetypenamereservedwords": true,
"useexperimentalpipelinedtransformer": false,
"enableiterativegsiupdates": true,
"secondarykeyasgsi": true,
"skipoverridemutationinputtypes": true
},
"frontend-ios": {
"enablexcodeintegration": true
},
"auth": {
"enablecaseinsensitivity": true,
"useinclusiveterminology": true,
"breakcirculardependency": true,
"forcealiasattributes": false
},
"codegen": {
"useappsyncmodelgenplugin": true,
"usedocsgeneratorplugin": true,
"usetypesgeneratorplugin": true,
"cleangeneratedmodelsdirectory": true,
"retaincasestyle": true,
"addtimestampfields": true,
"handlelistnullabilitytransparently": true,
"emitauthprovider": true,
"generateindexrules": true,
"enabledartnullsafety": true
},
"appsync": {
"generategraphqlpermissions": true
},
"latestregionsupport": {
"pinpoint": 1,
"translate": 1,
"transcribe": 1,
"rekognition": 1,
"textract": 1,
"comprehend": 1
},
"project": {
"overrides": true
"features": {
"graphqltransformer": {
"addmissingownerfields": true,
"improvepluralization": false,
"validatetypenamereservedwords": true,
"useexperimentalpipelinedtransformer": false,
"enableiterativegsiupdates": true,
"secondarykeyasgsi": true,
"skipoverridemutationinputtypes": true
},
"frontend-ios": {
"enablexcodeintegration": true
},
"auth": {
"enablecaseinsensitivity": true,
"useinclusiveterminology": true,
"breakcirculardependency": true,
"forcealiasattributes": false
},
"codegen": {
"useappsyncmodelgenplugin": true,
"usedocsgeneratorplugin": true,
"usetypesgeneratorplugin": true,
"cleangeneratedmodelsdirectory": true,
"retaincasestyle": true,
"addtimestampfields": true,
"handlelistnullabilitytransparently": true,
"emitauthprovider": true,
"generateindexrules": true,
"enabledartnullsafety": true
},
"appsync": {
"generategraphqlpermissions": true
},
"latestregionsupport": {
"pinpoint": 1,
"translate": 1,
"transcribe": 1,
"rekognition": 1,
"textract": 1,
"comprehend": 1
},
"project": {
"overrides": true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

public final class AmplifyModelProvider implements ModelProvider {
private static final String AMPLIFY_MODEL_VERSION = "60f05c329e96e718a1c603e8ce306b24";
private static final String AMPLIFY_MODEL_VERSION = "52523adac5d643063a009102021f267d";
private static AmplifyModelProvider amplifyGeneratedModelInstance;
private AmplifyModelProvider() {

Expand All @@ -34,7 +34,7 @@ public static AmplifyModelProvider getInstance() {
@Override
public Set<Class<? extends Model>> models() {
final Set<Class<? extends Model>> modifiableSet = new HashSet<>(
Arrays.<Class<? extends Model>>asList(Product.class, UserCart.class, User.class, Favourites.class, Category.class)
Arrays.<Class<? extends Model>>asList(Favorite.class, User.class, Category.class, Product.class)
);

return Immutable.of(modifiableSet);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.amplifyframework.datastore.generated.model;

import com.amplifyframework.core.model.temporal.Temporal;

import java.util.List;
import java.util.UUID;
Expand All @@ -21,13 +22,15 @@
/** This is an auto generated class representing the Category type in your schema. */
@SuppressWarnings("all")
@ModelConfig(pluralName = "Categories", authRules = {
@AuthRule(allow = AuthStrategy.PUBLIC, operations = { ModelOperation.CREATE, ModelOperation.UPDATE, ModelOperation.DELETE, ModelOperation.READ })
@AuthRule(allow = AuthStrategy.PRIVATE, operations = { ModelOperation.CREATE, ModelOperation.UPDATE, ModelOperation.DELETE, ModelOperation.READ })
})
public final class Category implements Model {
public static final QueryField ID = field("id");
public static final QueryField NAME = field("name");
public static final QueryField ID = field("Category", "id");
public static final QueryField NAME = field("Category", "name");
private final @ModelField(targetType="ID", isRequired = true) String id;
private final @ModelField(targetType="String", isRequired = true) String name;
private @ModelField(targetType="AWSDateTime", isReadOnly = true) Temporal.DateTime createdAt;
private @ModelField(targetType="AWSDateTime", isReadOnly = true) Temporal.DateTime updatedAt;
public String getId() {
return id;
}
Expand All @@ -36,6 +39,14 @@ public String getName() {
return name;
}

public Temporal.DateTime getCreatedAt() {
return createdAt;
}

public Temporal.DateTime getUpdatedAt() {
return updatedAt;
}

private Category(String id, String name) {
this.id = id;
this.name = name;
Expand All @@ -50,7 +61,9 @@ public boolean equals(Object obj) {
} else {
Category category = (Category) obj;
return ObjectsCompat.equals(getId(), category.getId()) &&
ObjectsCompat.equals(getName(), category.getName());
ObjectsCompat.equals(getName(), category.getName()) &&
ObjectsCompat.equals(getCreatedAt(), category.getCreatedAt()) &&
ObjectsCompat.equals(getUpdatedAt(), category.getUpdatedAt());
}
}

Expand All @@ -59,6 +72,8 @@ public int hashCode() {
return new StringBuilder()
.append(getId())
.append(getName())
.append(getCreatedAt())
.append(getUpdatedAt())
.toString()
.hashCode();
}
Expand All @@ -68,7 +83,9 @@ public String toString() {
return new StringBuilder()
.append("Category {")
.append("id=" + String.valueOf(getId()) + ", ")
.append("name=" + String.valueOf(getName()))
.append("name=" + String.valueOf(getName()) + ", ")
.append("createdAt=" + String.valueOf(getCreatedAt()) + ", ")
.append("updatedAt=" + String.valueOf(getUpdatedAt()))
.append("}")
.toString();
}
Expand All @@ -84,18 +101,8 @@ public static NameStep builder() {
* in a relationship.
* @param id the id of the existing item this instance will represent
* @return an instance of this model with only ID populated
* @throws IllegalArgumentException Checks that ID is in the proper format
*/
public static Category justId(String id) {
try {
UUID.fromString(id); // Check that ID is in the UUID format - if not an exception is thrown
} catch (Exception exception) {
throw new IllegalArgumentException(
"Model IDs must be unique in the format of UUID. This method is for creating instances " +
"of an existing object with only its ID field for sending as a mutation parameter. When " +
"creating a new object, use the standard builder method and leave the ID field blank."
);
}
return new Category(
id,
null
Expand All @@ -113,7 +120,7 @@ public interface NameStep {

public interface BuildStep {
Category build();
BuildStep id(String id) throws IllegalArgumentException;
BuildStep id(String id);
}


Expand All @@ -137,22 +144,11 @@ public BuildStep name(String name) {
}

/**
* WARNING: Do not set ID when creating a new object. Leave this blank and one will be auto generated for you.
* This should only be set when referring to an already existing object.
* @param id id
* @return Current Builder instance, for fluent method chaining
* @throws IllegalArgumentException Checks that ID is in the proper format
*/
public BuildStep id(String id) throws IllegalArgumentException {
public BuildStep id(String id) {
this.id = id;

try {
UUID.fromString(id); // Check that ID is in the UUID format - if not an exception is thrown
} catch (Exception exception) {
throw new IllegalArgumentException("Model IDs must be unique in the format of UUID.",
exception);
}

return this;
}
}
Expand Down
Loading