generated from karvounis/simple-terraform-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement forem_listing resource (#7)
* add forem_listing resource schema * add golint in pre-commit * add read and create functionality to forem_listing resource * Add test for create draft listing Also, make changes based on golint suggestions * add test for listing resource to publish Tests now test the successful publish of a listing * Improve SchemaDescriptionBuilder Logs AtLeastOneOf, ConflictsWith, RequiredWith, MinItems and MaxItems * add dev-client-go 1.1.3 dependency * keep myself dry TestAccListing_draft now reuses the getListingBodySchemaToPublish method to create a ListingBodySchema * upgrade to dev-client-go 1.2.0 * Add golangci-lint to pre-commit * simpify tags section * update listing now works like a charm * add update listing tests
- Loading branch information
Showing
16 changed files
with
579 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,4 @@ vendor/ | |
.vscode/ | ||
|
||
.env | ||
ex/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,37 @@ | ||
linters: | ||
disable-all: true | ||
enable: | ||
- asciicheck | ||
- bodyclose | ||
- contextcheck | ||
- deadcode | ||
- gofmt | ||
- durationcheck | ||
- errname | ||
- gomnd | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- makezero | ||
- misspell | ||
- nakedret | ||
- nilerr | ||
- noctx | ||
- nolintlint | ||
- revive | ||
- staticcheck | ||
- structcheck | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- varcheck | ||
- vet | ||
- wastedassign | ||
linters-settings: | ||
revive: | ||
ignore-generated-header: true | ||
severity: warning | ||
rules: | ||
- name: atomic | ||
- name: var-naming | ||
disabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "forem_listing Resource - terraform-provider-forem" | ||
subcategory: "" | ||
description: |- | ||
forem_listing resource creates and updates a particular listing. A listing is a classified ad that users create on Forem. They can be related to conference announcements, job offers, mentorships, upcoming events and more. | ||
API Docs | ||
https://developers.forem.com/api#operation/createListinghttps://developers.forem.com/api#operation/updateListing | ||
--- | ||
|
||
# forem_listing (Resource) | ||
|
||
`forem_listing` resource creates and updates a particular listing. A listing is a classified ad that users create on Forem. They can be related to conference announcements, job offers, mentorships, upcoming events and more. | ||
|
||
## API Docs | ||
|
||
- https://developers.forem.com/api#operation/createListing | ||
- https://developers.forem.com/api#operation/updateListing | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `body_markdown` (String) The body of the listing in Markdown format. | ||
- `category` (String) The category that the listing belongs to. | ||
- `title` (String) Title of the listing. | ||
|
||
### Optional | ||
|
||
- `action` (String) Set it to `draft` to create an unpublished listing. | ||
- `contact_via_connect` (Boolean) True if users are allowed to contact the listing's owner via DEV connect, false otherwise. Defaults to: `false`. | ||
- `expires_at` (String) Date and time of expiration. | ||
- `location` (String) Geographical area or city for the listing. | ||
- `organization_id` (Number) The id of the organization the user is creating the listing for. Only users belonging to an organization can assign the listing to it. | ||
- `tags` (List of String) List of tags related to the listing. Maximum items: `8`. | ||
|
||
### Read-Only | ||
|
||
- `created_at` (String) When the listing was created. | ||
- `id` (String) ID of the listing. | ||
- `organization` (Map of String) Organization object of the listing. | ||
- `published` (Boolean) Whether the listing is published or not. | ||
- `slug` (String) Slug of the listing. | ||
- `updated_at` (String) When the listing was updated. | ||
- `user` (Map of String) User object of the listing. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.