Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: pipeline to make ns-npa-publisher #1

Merged
merged 2 commits into from
Nov 2, 2023
Merged
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@
# Go workspace file
go.work

# JetBrains IDE files
*.iml

.DS_Store
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.PHONY: *

all: npa_publisher_tf_provider

docs:
go generate ./...

terraform-provider-ns-npa-publisher: terraform-provider-ns-npa-publisher/npa_publisher.yaml
speakeasy generate sdk --lang terraform -o terraform-provider-ns-npa-publisher -s terraform-provider-ns-npa-publisher/npa_publisher.yaml

terraform-provider-ns-npa-publisher/npa_publisher.yaml: check-speakeasy check-local-oas
mkdir -p terraform-provider-ns-npa-publisher
cp ${NETSKOPE_LOCAL_OAS_REPO}/endpoints/infrastructure/npa_publisher.yaml terraform-provider-ns-npa-publisher/npa_publisher.yaml
speakeasy overlay apply -s ${NETSKOPE_LOCAL_OAS_REPO}/endpoints/infrastructure/npa_publisher.yaml -o ${NETSKOPE_LOCAL_OAS_REPO}/endpoints/infrastructure/npa_publisher_tf.yaml > terraform-provider-ns-npa-publisher/npa_publisher.yaml

check-speakeasy:
@command -v speakeasy >/dev/null 2>&1 || { echo >&2 "speakeasy CLI is not installed. Please install before continuing."; exit 1; }

check-local-oas:
ifndef NETSKOPE_LOCAL_OAS_REPO
$(error Environment variable NETSKOPE_LOCAL_OAS_REPO is undefined)
endif
ifneq ($(wildcard ${NETSKOPE_LOCAL_OAS_REPO}/.*),)
@echo "Found ${NETSKOPE_LOCAL_OAS_REPO}."
else
@echo "Did not find ${NETSKOPE_LOCAL_OAS_REPO}."
endif

2 changes: 2 additions & 0 deletions terraform-provider-ns-npa-publisher/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This allows generated code to be indexed correctly
*.go linguist-generated=false
4 changes: 4 additions & 0 deletions terraform-provider-ns-npa-publisher/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.terraform
.terraform*
*.tfstate*
.DS_Store
144 changes: 144 additions & 0 deletions terraform-provider-ns-npa-publisher/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# npa-publisher

<div align="left">
<a href="https://speakeasyapi.dev/"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
</div>


<!-- Start SDK SDK Installation -->
## SDK Installation

To install this provider, copy and paste this code into your Terraform configuration. Then, run `terraform init`.

```hcl
terraform {
required_providers {
npa-publisher = {
source = "netskope/npa-publisher"
version = "0.0.1"
}
}
}

provider "npa-publisher" {
# Configuration options
}
```
<!-- End SDK SDK Installation -->

## SDK Example Usage

<!-- Start SDK SDK Example Usage -->
## Testing the provider locally

Should you want to validate a change locally, the `--debug` flag allows you to execute the provider against a terraform instance locally.

This also allows for debuggers (e.g. delve) to be attached to the provider.

```sh
go run main.go --debug
# Copy the TF_REATTACH_PROVIDERS env var
# In a new terminal
cd examples/your-example
TF_REATTACH_PROVIDERS=... terraform init
TF_REATTACH_PROVIDERS=... terraform apply
```
<!-- End SDK SDK Example Usage -->


<!-- Start SDK SDK Available Operations -->

<!-- End SDK SDK Available Operations -->


<!-- Start SDK Dev Containers -->



<!-- End SDK Dev Containers -->



<!-- Start SDK Installation -->
## SDK Installation

To install this provider, copy and paste this code into your Terraform configuration. Then, run `terraform init`.

```hcl
terraform {
required_providers {
npa-publisher = {
source = "netskope/npa-publisher"
version = "0.0.1"
}
}
}

provider "npa-publisher" {
# Configuration options
}
```
<!-- End SDK Installation -->



## SDK Example Usage
<!-- Start SDK Example Usage -->
## Testing the provider locally

Should you want to validate a change locally, the `--debug` flag allows you to execute the provider against a terraform instance locally.

This also allows for debuggers (e.g. delve) to be attached to the provider.

```sh
go run main.go --debug
# Copy the TF_REATTACH_PROVIDERS env var
# In a new terminal
cd examples/your-example
TF_REATTACH_PROVIDERS=... terraform init
TF_REATTACH_PROVIDERS=... terraform apply
```
<!-- End SDK Example Usage -->



<!-- Start SDK Available Operations -->

<!-- End SDK Available Operations -->



<!-- Start Dev Containers -->



<!-- End Dev Containers -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

Terraform allows you to use local provider builds by setting a `dev_overrides` block in a configuration file called `.terraformrc`. This block overrides all other configured installation methods.

Terraform searches for the `.terraformrc` file in your home directory and applies any configuration settings you set.

```
provider_installation {

dev_overrides {
"registry.terraform.io/npa-publisher/scaffolding" = "<PATH>"
}

# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}
```

Your `<PATH>` may vary depending on how your Go environment variables are configured. Execute `go env GOBIN` to set it, then set the `<PATH>` to the value returned. If nothing is returned, set it to the default location, `$HOME/go/bin`.

### Contributions

While we value open-source contributions to this SDK, this library is generated programmatically.
Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!

### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)
16 changes: 16 additions & 0 deletions terraform-provider-ns-npa-publisher/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Start SDK Example Usage -->
## Testing the provider locally

Should you want to validate a change locally, the `--debug` flag allows you to execute the provider against a terraform instance locally.

This also allows for debuggers (e.g. delve) to be attached to the provider.

```sh
go run main.go --debug
# Copy the TF_REATTACH_PROVIDERS env var
# In a new terminal
cd examples/your-example
TF_REATTACH_PROVIDERS=... terraform init
TF_REATTACH_PROVIDERS=... terraform apply
```
<!-- End SDK Example Usage -->
1 change: 1 addition & 0 deletions terraform-provider-ns-npa-publisher/examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "npa-publisher_npa_publisher" "my_npapublisher" {
id = 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "npa-publisher_npa_publisher_apps" "my_npapublisherapps" {
publisher_id = 8
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "npa-publisher_npa_publisher_releases" "my_npapublisherreleases" {
fields = "...my_fields..."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "npa-publisher_npa_publishers" "my_npapublishers" {
fields = "...my_fields..."
}
12 changes: 12 additions & 0 deletions terraform-provider-ns-npa-publisher/examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
terraform {
required_providers {
npa-publisher = {
source = "netskope/npa-publisher"
version = "0.0.1"
}
}
}

provider "npa-publisher" {
# Configuration options
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resource "npa-publisher_npa_publisher" "my_npapublisher" {
lbrokerconnect = true
name = "Mr. Bessie Hickle DVM"
publisher_upgrade_profiles_id = 5
tags = [
{
tag_id = 9
tag_name = "...my_tag_name..."
},
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource "npa-publisher_publisher_token" "my_publishertoken" {
publisher_id = 9
}
129 changes: 129 additions & 0 deletions terraform-provider-ns-npa-publisher/files.gen
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
internal/sdk/npapublisherapps.go
internal/sdk/npapublisherreleases.go
internal/sdk/npapublishers.go
internal/sdk/publishertoken.go
internal/sdk/sdk.go
examples/README.md
go.mod
go.sum
internal/planmodifiers/boolplanmodifier/suppress_diff.go
internal/planmodifiers/float64planmodifier/suppress_diff.go
internal/planmodifiers/int64planmodifier/suppress_diff.go
internal/planmodifiers/listplanmodifier/suppress_diff.go
internal/planmodifiers/mapplanmodifier/suppress_diff.go
internal/planmodifiers/numberplanmodifier/suppress_diff.go
internal/planmodifiers/objectplanmodifier/suppress_diff.go
internal/planmodifiers/setplanmodifier/suppress_diff.go
internal/planmodifiers/stringplanmodifier/suppress_diff.go
internal/planmodifiers/utils/state_check.go
internal/provider/reflect/diags.go
internal/provider/reflect/doc.go
internal/provider/reflect/generic_attr_value.go
internal/provider/reflect/helpers.go
internal/provider/reflect/interfaces.go
internal/provider/reflect/into.go
internal/provider/reflect/map.go
internal/provider/reflect/number.go
internal/provider/reflect/options.go
internal/provider/reflect/outof.go
internal/provider/reflect/pointer.go
internal/provider/reflect/primitive.go
internal/provider/reflect/slice.go
internal/provider/reflect/struct.go
internal/provider/utils.go
internal/sdk/pkg/models/sdkerrors/sdkerror.go
internal/sdk/pkg/types/bigint.go
internal/sdk/pkg/types/date.go
internal/sdk/pkg/types/datetime.go
internal/sdk/pkg/types/decimal.go
internal/sdk/pkg/types/pointers.go
internal/sdk/pkg/utils/contenttype.go
internal/sdk/pkg/utils/form.go
internal/sdk/pkg/utils/headers.go
internal/sdk/pkg/utils/json.go
internal/sdk/pkg/utils/pathparams.go
internal/sdk/pkg/utils/queryparams.go
internal/sdk/pkg/utils/requestbody.go
internal/sdk/pkg/utils/retries.go
internal/sdk/pkg/utils/security.go
internal/sdk/pkg/utils/utils.go
internal/validators/DateValidator.go
internal/validators/ExactlyOneChild.go
internal/validators/JSONParseValidator.go
internal/validators/RFC3339Validator.go
main.go
terraform-registry-manifest.json
tools/tools.go
internal/sdk/pkg/models/operations/getinfrastructurepublisherspublisheridapps.go
internal/sdk/pkg/models/operations/getinfrastructurepublishersreleases.go
internal/sdk/pkg/models/operations/postinfrastructurepublishers.go
internal/sdk/pkg/models/operations/deleteinfrastructurepublisherspublisherid.go
internal/sdk/pkg/models/operations/getinfrastructurepublishers.go
internal/sdk/pkg/models/operations/getinfrastructurepublisherspublisherid.go
internal/sdk/pkg/models/operations/putinfrastructurepublisherspublisherid.go
internal/sdk/pkg/models/operations/postinfrastructurepublisherspublisheridregistrationtoken.go
internal/sdk/pkg/models/operations/getinfrastructurepublishersalertsconfiguration.go
internal/sdk/pkg/models/operations/patchinfrastructurepublisherspublisherid.go
internal/sdk/pkg/models/operations/putinfrastructurepublishersalertsconfiguration.go
internal/sdk/pkg/models/operations/putinfrastructurepublishersbulk.go
internal/sdk/pkg/models/shared/publishersresponse400.go
internal/sdk/pkg/models/shared/privateappsresponse.go
internal/sdk/pkg/models/shared/tagitem.go
internal/sdk/pkg/models/shared/servicepublisherassignmentitem.go
internal/sdk/pkg/models/shared/protocolresponseitem.go
internal/sdk/pkg/models/shared/publishersreleasegetresponse.go
internal/sdk/pkg/models/shared/releaseitem.go
internal/sdk/pkg/models/shared/publisherresponse.go
internal/sdk/pkg/models/shared/publisherpostrequest.go
internal/sdk/pkg/models/shared/tagitemnoid.go
internal/sdk/pkg/models/shared/publishersgetresponse.go
internal/sdk/pkg/models/shared/data.go
internal/sdk/pkg/models/shared/publisher.go
internal/sdk/pkg/models/shared/upgradestatus.go
internal/sdk/pkg/models/shared/upgradefailedreason.go
internal/sdk/pkg/models/shared/assessment.go
internal/sdk/pkg/models/shared/publisherputrequest.go
internal/sdk/pkg/models/shared/publishersalertgetresponse.go
internal/sdk/pkg/models/shared/publishersalertputresponse.go
internal/sdk/pkg/models/shared/publishersalertputrequest.go
internal/sdk/pkg/models/shared/publishersbulkresponse.go
internal/sdk/pkg/models/shared/publisherbulkitem.go
internal/sdk/pkg/models/shared/publisherbulkrequest.go
internal/sdk/pkg/models/shared/security.go
internal/provider/type_tag_item.go
internal/provider/type_protocol_response_item.go
internal/provider/type_service_publisher_assignment_item_reachability.go
internal/provider/type_service_publisher_assignment_item.go
internal/provider/type_private_apps_response_data.go
internal/provider/type_release_item.go
internal/provider/type_assessment.go
internal/provider/type_publisher_assessment2.go
internal/provider/type_publisher_assessment.go
internal/provider/type_publisher_stitcher_id.go
internal/provider/type_upgrade_failed_reason.go
internal/provider/type_publisher_upgrade_failed_reason.go
internal/provider/type_upgrade_status.go
internal/provider/type_publisher.go
internal/provider/type_data.go
USAGE.md
internal/provider/provider.go
examples/provider/provider.tf
internal/provider/npapublisher_resource.go
internal/provider/npapublisher_resource_sdk.go
examples/resources/npa-publisher_npa_publisher/resource.tf
internal/provider/publishertoken_resource.go
internal/provider/publishertoken_resource_sdk.go
examples/resources/npa-publisher_publisher_token/resource.tf
internal/provider/npapublisher_data_source.go
internal/provider/npapublisher_data_source_sdk.go
examples/data-sources/npa-publisher_npa_publisher/data-source.tf
internal/provider/npapublisherapps_data_source.go
internal/provider/npapublisherapps_data_source_sdk.go
examples/data-sources/npa-publisher_npa_publisher_apps/data-source.tf
internal/provider/npapublisherreleases_data_source.go
internal/provider/npapublisherreleases_data_source_sdk.go
examples/data-sources/npa-publisher_npa_publisher_releases/data-source.tf
internal/provider/npapublishers_data_source.go
internal/provider/npapublishers_data_source_sdk.go
examples/data-sources/npa-publisher_npa_publishers/data-source.tf
.gitattributes
Loading