Skip to content

Commit

Permalink
add a little complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasRooney committed Jul 12, 2023
1 parent c656a63 commit 871b4f3
Show file tree
Hide file tree
Showing 18 changed files with 161 additions and 78 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.PHONY: *
.PHONY: all docs
all: speakeasy docs

speakeasy:
speakeasy generate sdk --lang terraform -o . -s hashicups.yaml

docs:
go generate ./...
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ It works by using the [Speakeasy](https://speakeasyapi.dev) platform and associa
This provider is for demonstration purposes only. Do not publish this to the terraform registry.

<!-- Start SDK Installation -->
## Notice of Alpha Status

This is a Alpha release of the hashicups Terraform Provider.

It is under active development and you may experience breaking changes. Please pin to a version if trialing in production.

## SDK Installation

To install this provider, copy and paste this code into your Terraform configuration. Then, run `terraform init`.
Expand All @@ -21,7 +15,7 @@ To install this provider, copy and paste this code into your Terraform configura
terraform {
required_providers {
hashicups = {
source = "hashicorp/hashicups"
source = "speakeasy/hashicups"
version = "0.0.1"
}
}
Expand Down
21 changes: 18 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "hashicups Provider"
page_title: "hashicups-speakeasy Provider"
subcategory: ""
description: |-
Hashicups: Example Hashicups through Speakeasy
---

# hashicups Provider
# hashicups-speakeasy Provider

Hashicups: Example Hashicups through Speakeasy

## Example Usage

```terraform
terraform {
required_providers {
hashicups = {
source = "speakeasy/hashicups"
version = "0.0.1"
}
}
}
provider "hashicups" {
# Configuration options
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
40 changes: 40 additions & 0 deletions docs/resources/hashicups_order.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "hashicups_order Resource - terraform-provider-hashicups-speakeasy"
subcategory: ""
description: |-
Order Resource
---

# hashicups_order (Resource)

Order Resource

## Example Usage

```terraform
resource "hashicups_order" "my_order" {
description = "...my_description..."
image = "...my_image..."
name = "Terrence Rau"
price = 85.8
teaser = "...my_teaser..."
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `description` (String) Product description of the coffee.
- `image` (String) URI for an image of the coffee.
- `name` (String) Product name of the coffee.
- `price` (Number) Suggested cost of the coffee.
- `teaser` (String) Fun tagline for the coffee.

### Read-Only

- `id` (Number) Order ID


30 changes: 0 additions & 30 deletions docs/resources/order.md

This file was deleted.

12 changes: 12 additions & 0 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
terraform {
required_providers {
hashicups = {
source = "speakeasy/hashicups"
version = "0.0.1"
}
}
}

provider "hashicups" {
# Configuration options
}
7 changes: 7 additions & 0 deletions examples/resources/hashicups_order/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "hashicups_order" "my_order" {
description = "...my_description..."
image = "...my_image..."
name = "Terrence Rau"
price = 85.8
teaser = "...my_teaser..."
}
5 changes: 4 additions & 1 deletion files.gen
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ internal/sdk/pkg/models/operations/deleteorder.go
internal/sdk/pkg/models/operations/getorder.go
internal/sdk/pkg/models/operations/upsertorder.go
internal/sdk/pkg/models/shared/order.go
internal/sdk/pkg/models/shared/createorderinput.go
internal/sdk/pkg/models/shared/security.go
USAGE.md
internal/provider/provider.go
examples/provider/provider.tf
internal/provider/order_resource.go
internal/provider/order_resource_sdk.go
internal/provider/order_resource_sdk.go
examples/resources/hashicups_order/resource.tf
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ generation:
telemetryEnabled: false
terraform:
version: 0.0.1
author: hashicorp
author: speakeasy
packageName: hashicups
35 changes: 31 additions & 4 deletions hashicups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/Order"
$ref: "#/components/schemas/CreateOrderInput"
required: true
responses:
"200":
Expand Down Expand Up @@ -76,16 +76,42 @@ paths:
- Order
components:
schemas:
CreateOrderInput:
description: An input object to creating an order
x-speakeasy-entity: Order
properties:
name:
type: string
description: Product name of the coffee.
teaser:
type: string
description: Fun tagline for the coffee.
description:
type: string
description: Product description of the coffee.
price:
type: number
description: Suggested cost of the coffee.
image:
type: string
description: URI for an image of the coffee.
required:
- name
- teaser
- description
- price
- image
type: object
Order:
description: An order helps you make coffee
x-speakeasy-entity: Order
properties:
id:
type: integer
description: Numeric identifier of the order.
name:
type: string
description: Product name of the coffee.
id:
type: integer
description: Order ID
teaser:
type: string
description: Fun tagline for the coffee.
Expand All @@ -99,6 +125,7 @@ components:
type: string
description: URI for an image of the coffee.
required:
- id
- name
- teaser
- description
Expand Down
22 changes: 13 additions & 9 deletions internal/provider/order_resource.go

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

23 changes: 6 additions & 17 deletions internal/provider/order_resource_sdk.go

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

1 change: 1 addition & 0 deletions internal/provider/provider.go

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

2 changes: 1 addition & 1 deletion internal/sdk/order.go

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

17 changes: 17 additions & 0 deletions internal/sdk/pkg/models/shared/createorderinput.go

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

4 changes: 2 additions & 2 deletions internal/sdk/pkg/models/shared/order.go

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

Loading

0 comments on commit 871b4f3

Please sign in to comment.