<BlockSwitcher>
<Block name="Java">

```java
Post post = Post.builder()
    .title("My First Post")
    .status(PostStatus.ACTIVE)
    .rating(10)
    .build();

Amplify.DataStore.save(post,
    saved -> Log.i("MyAmplifyApp", "Saved a post."),
    failure -> Log.e("MyAmplifyApp", "Save failed.", failure)
);
```

</Block>
<Block name="Kotlin - Callbacks">

```kotlin
val post = Post.builder()
    .title("My First Post")
    .status(PostStatus.ACTIVE)
    .rating(10)
    .build()

Amplify.DataStore.save(post,
    { Log.i("MyAmplifyApp", "Saved a post") },
    { Log.e("MyAmplifyApp", "Save failed", it) }
)
```

</Block>
<Block name="Kotlin - Coroutines">

```kotlin
val post = Post.builder()
    .title("My First Post")
    .status(PostStatus.ACTIVE)
    .rating(10)
    .build()
try {
    Amplify.DataStore.save(post)
    Log.i("MyAmplifyApp", "Saved a post.")
} catch (error: DataStoreException) {
    Log.e("MyAmplifyApp", "Save failed.", error)
}
```

</Block>
<Block name="RxJava">

```java
Post post = Post.builder()
    .title("My First Post")
    .status(PostStatus.ACTIVE)
    .rating(10)
    .build();

RxAmplify.DataStore.save(post)
    .subscribe(
        () -> Log.i("MyAmplifyApp", "Saved a post."),
        failure -> Log.e("MyAmplifyApp", "Save failed.", failure)
    );
```

</Block>
</BlockSwitcher>
