magic_hour 0.61.0

Magic Hour Rust SDK
Documentation
# v1.ai_qr_code_generator

## Module Functions

### AI QR Code Generator <a name="create"></a>

Create an AI QR code. Each QR code costs 0 credits.

**API Endpoint**: `POST /v1/ai-qr-code-generator`

#### Parameters

| Parameter      | Required | Description                                                                                                                                                                                                                                 | Example                                                                    |
| -------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `content`      |    ✓     | The content of the QR code.                                                                                                                                                                                                                 | `"https://magichour.ai".to_string()`                                       |
| `style`        |    ✓     |                                                                                                                                                                                                                                             | `V1AiQrCodeGeneratorCreateBodyStyle {art_style: "Watercolor".to_string()}` |
| `└─ art_style` |    ✓     | To use our templates, pass in one of Watercolor, Cyberpunk City, Ink Landscape, Interior Painting, Japanese Street, Mech, Minecraft, Picasso Painting, Game Map, Spaceship, Chinese Painting, Winter Village, or pass any custom art style. | `"Watercolor".to_string()`                                                 |
| `name`         |    ✗     | Give your image a custom name for easy identification.                                                                                                                                                                                      | `"My Qr Code image".to_string()`                                           |

#### Example Snippet

```rust
let client = magic_hour::Client::default()
    .with_bearer_auth(&std::env::var("API_TOKEN").unwrap());
let res = client
    .v1()
    .ai_qr_code_generator()
    .create(magic_hour::resources::v1::ai_qr_code_generator::CreateRequest {
        content: "https://magichour.ai".to_string(),
        name: Some("My Qr Code image".to_string()),
        style: magic_hour::models::V1AiQrCodeGeneratorCreateBodyStyle {
            art_style: "Watercolor".to_string(),
        },
    })
    .await;
```

#### Response

##### Type

[V1AiQrCodeGeneratorCreateResponse](/src/models/v1_ai_qr_code_generator_create_response.rs)

##### Example

```rust
V1AiQrCodeGeneratorCreateResponse {credits_charged: 0, frame_cost: 0, id: "cuid-example".to_string()}
```