mirror of
https://github.com/LukeHagar/plexterraform.git
synced 2025-12-06 04:20:52 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.241.0
This commit is contained in:
@@ -3,22 +3,22 @@ id: e742591b-391d-4f4e-8484-d01a093b32ec
|
||||
management:
|
||||
docChecksum: a91eaf9ec1e6a3a6f4bf0571f5b18bae
|
||||
docVersion: 0.0.3
|
||||
speakeasyVersion: 1.228.1
|
||||
generationVersion: 2.292.0
|
||||
releaseVersion: 0.9.0
|
||||
configChecksum: 099f930233140a9803ac3954f0314d49
|
||||
speakeasyVersion: 1.241.0
|
||||
generationVersion: 2.300.0
|
||||
releaseVersion: 0.10.0
|
||||
configChecksum: 209a06e636e3932f0cf252f8833149be
|
||||
repoURL: https://github.com/LukeHagar/plexterraform.git
|
||||
repoSubDirectory: .
|
||||
published: true
|
||||
features:
|
||||
terraform:
|
||||
constsAndDefaults: 0.1.4
|
||||
core: 3.12.1
|
||||
core: 3.17.0
|
||||
globalSecurity: 2.81.6
|
||||
globalServerURLs: 2.82.1
|
||||
globals: 2.82.1
|
||||
methodServerURLs: 2.82.1
|
||||
nameOverrides: 2.81.1
|
||||
nameOverrides: 2.81.2
|
||||
generatedFiles:
|
||||
- internal/sdk/server.go
|
||||
- internal/sdk/media.go
|
||||
|
||||
@@ -12,7 +12,7 @@ generation:
|
||||
auth:
|
||||
oAuth2ClientCredentialsEnabled: false
|
||||
terraform:
|
||||
version: 0.9.0
|
||||
version: 0.10.0
|
||||
author: LukeHagar
|
||||
imports:
|
||||
option: openapi
|
||||
|
||||
@@ -61,7 +61,7 @@ terraform {
|
||||
required_providers {
|
||||
PlexAPI = {
|
||||
source = "LukeHagar/PlexAPI"
|
||||
version = "0.9.0"
|
||||
version = "0.10.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,3 +159,11 @@ Based on:
|
||||
- Speakeasy CLI 1.228.1 (2.292.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [terraform v0.9.0] .
|
||||
|
||||
## 2024-04-06 01:03:34
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.241.0 (2.300.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [terraform v0.10.0] .
|
||||
@@ -17,7 +17,7 @@ terraform {
|
||||
required_providers {
|
||||
PlexAPI = {
|
||||
source = "LukeHagar/PlexAPI"
|
||||
version = "0.9.0"
|
||||
version = "0.10.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ terraform {
|
||||
required_providers {
|
||||
PlexAPI = {
|
||||
source = "LukeHagar/PlexAPI"
|
||||
version = "0.9.0"
|
||||
version = "0.10.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ func commaSeparatedString(in []string) string {
|
||||
|
||||
// getStructTags returns a map of Terraform field names to their position in
|
||||
// the tags of the struct `in`. `in` must be a struct.
|
||||
func getStructTags(_ context.Context, in reflect.Value, path path.Path) (map[string]int, error) {
|
||||
func getStructTags(_ context.Context, in reflect.Value, path path.Path, opts Options) (map[string]int, error) {
|
||||
tags := map[string]int{}
|
||||
typ := trueReflectValue(in).Type()
|
||||
if typ.Kind() != reflect.Struct {
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
|
||||
package reflect
|
||||
|
||||
const (
|
||||
SourceTypeState = iota
|
||||
SourceTypePlan
|
||||
)
|
||||
|
||||
// Options provides configuration settings for how the reflection behavior
|
||||
// works, letting callers tweak different behaviors based on their needs.
|
||||
type Options struct {
|
||||
@@ -19,4 +24,8 @@ type Options struct {
|
||||
// perfectly in the types they're being stored in, rather than
|
||||
// returning errors. Numbers will always be rounded towards 0.
|
||||
AllowRoundingNumbers bool
|
||||
// SourceType informs the reflection system what the source is
|
||||
// such that it can make decisions based on the tfPlanOnly annotation
|
||||
// The default is SourceTypeState
|
||||
SourceType int
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ func Struct(ctx context.Context, typ attr.Type, object tftypes.Value, target ref
|
||||
|
||||
// collect a map of fields that are defined in the tags of the struct
|
||||
// passed in
|
||||
targetFields, err := getStructTags(ctx, target, path)
|
||||
targetFields, err := getStructTags(ctx, target, path, opts)
|
||||
if err != nil {
|
||||
diags.Append(diag.WithPath(path, DiagIntoIncompatibleType{
|
||||
Val: object,
|
||||
@@ -125,7 +125,8 @@ func Struct(ctx context.Context, typ attr.Type, object tftypes.Value, target ref
|
||||
} else {
|
||||
result = reflect.New(target.Type()).Elem()
|
||||
}
|
||||
// Fork End
|
||||
structType := trueReflectValue(target).Type()
|
||||
|
||||
for field, structFieldPos := range targetFields {
|
||||
attrType, ok := attrTypes[field]
|
||||
if !ok {
|
||||
@@ -136,6 +137,13 @@ func Struct(ctx context.Context, typ attr.Type, object tftypes.Value, target ref
|
||||
}))
|
||||
return target, diags
|
||||
}
|
||||
|
||||
fieldReflected := structType.Field(structFieldPos)
|
||||
if opts.SourceType == SourceTypeState && fieldReflected.Tag.Get(`tfPlanOnly`) == "true" {
|
||||
// skip explicitly excluded fields
|
||||
continue
|
||||
}
|
||||
// Fork End
|
||||
structField := result.Field(structFieldPos)
|
||||
fieldVal, fieldValDiags := BuildValue(ctx, attrType, objectFields[field], structField, opts, path.AtName(field))
|
||||
diags.Append(fieldValDiags...)
|
||||
@@ -162,7 +170,7 @@ func FromStruct(ctx context.Context, typ attr.TypeWithAttributeTypes, val reflec
|
||||
|
||||
// collect a map of fields that are defined in the tags of the struct
|
||||
// passed in
|
||||
targetFields, err := getStructTags(ctx, val, path)
|
||||
targetFields, err := getStructTags(ctx, val, path, Options{})
|
||||
if err != nil {
|
||||
err = fmt.Errorf("error retrieving field names from struct tags: %w", err)
|
||||
diags.AddAttributeError(
|
||||
|
||||
@@ -11,13 +11,15 @@ import (
|
||||
"github.com/hashicorp/terraform-plugin-framework/path"
|
||||
"github.com/hashicorp/terraform-plugin-framework/resource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types"
|
||||
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
func debugResponse(response *http.Response) string {
|
||||
if v := response.Request.Header.Get("X-Plex-Token"); v != "" {
|
||||
response.Request.Header.Set("X-Plex-Token", "(sensitive)")
|
||||
}
|
||||
dumpReq, err := httputil.DumpRequest(response.Request, true)
|
||||
if err != nil {
|
||||
dumpReq, err = httputil.DumpRequest(response.Request, false)
|
||||
@@ -60,11 +62,15 @@ func merge(ctx context.Context, req resource.UpdateRequest, resp *resource.Updat
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
resp.Diagnostics.Append(state.As(ctx, target, basetypes.ObjectAsOptions{
|
||||
val, err := state.ToTerraformValue(ctx)
|
||||
if err != nil {
|
||||
resp.Diagnostics.Append(diag.NewErrorDiagnostic("Object Conversion Error", "An unexpected error was encountered trying to convert object. This is always an error in the provider. Please report the following to the provider developer:\n\n"+err.Error()))
|
||||
return
|
||||
}
|
||||
resp.Diagnostics.Append(tfReflect.Into(ctx, types.ObjectType{AttrTypes: state.AttributeTypes(ctx)}, val, target, tfReflect.Options{
|
||||
UnhandledNullAsEmpty: true,
|
||||
UnhandledUnknownAsEmpty: true,
|
||||
})...)
|
||||
}, path.Empty())...)
|
||||
if resp.Diagnostics.HasError() {
|
||||
return
|
||||
}
|
||||
@@ -82,5 +88,6 @@ func refreshPlan(ctx context.Context, plan types.Object, target interface{}, dia
|
||||
diagnostics.Append(tfReflect.Into(ctx, obj, val, target, tfReflect.Options{
|
||||
UnhandledNullAsEmpty: true,
|
||||
UnhandledUnknownAsEmpty: true,
|
||||
SourceType: tfReflect.SourceTypePlan,
|
||||
}, path.Empty())...)
|
||||
}
|
||||
|
||||
@@ -279,8 +279,8 @@ func New(opts ...SDKOption) *PlexAPI {
|
||||
Language: "go",
|
||||
OpenAPIDocVersion: "0.0.3",
|
||||
SDKVersion: "0.0.1",
|
||||
GenVersion: "2.292.0",
|
||||
UserAgent: "speakeasy-sdk/go 0.0.1 2.292.0 0.0.3 github.com/LukeHagar/terraform-provider-PlexAPI/internal/sdk",
|
||||
GenVersion: "2.300.0",
|
||||
UserAgent: "speakeasy-sdk/go 0.0.1 2.300.0 0.0.3 github.com/LukeHagar/terraform-provider-PlexAPI/internal/sdk",
|
||||
Globals: map[string]map[string]map[string]interface{}{
|
||||
"parameters": {},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user