Skip to content

Commit

Permalink
re-generate providers with new code structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jlarfors committed Apr 16, 2024
1 parent 917d9f1 commit 4deecce
Show file tree
Hide file tree
Showing 20,815 changed files with 3,439,114 additions and 3,453,780 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
224 changes: 224 additions & 0 deletions archive/2.4.2/archive_file/archive_file.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
// CODE GENERATED BY github.com/golingon/lingon. DO NOT EDIT.

package archive_file

import (
"encoding/json"
"fmt"
"github.com/golingon/lingon/pkg/terra"
"io"
)

// New creates a new instance of [Resource].
func New(name string, args Args) *Resource {
return &Resource{
Args: args,
Name: name,
}
}

var _ terra.Resource = (*Resource)(nil)

// Resource represents the Terraform resource archive_file.
type Resource struct {
Name string
Args Args
state *archiveFileState
DependsOn terra.Dependencies
Lifecycle *terra.Lifecycle
}

// Type returns the Terraform object type for [Resource].
func (af *Resource) Type() string {
return "archive_file"
}

// LocalName returns the local name for [Resource].
func (af *Resource) LocalName() string {
return af.Name
}

// Configuration returns the configuration (args) for [Resource].
func (af *Resource) Configuration() interface{} {
return af.Args
}

// DependOn is used for other resources to depend on [Resource].
func (af *Resource) DependOn() terra.Reference {
return terra.ReferenceResource(af)
}

// Dependencies returns the list of resources [Resource] depends_on.
func (af *Resource) Dependencies() terra.Dependencies {
return af.DependsOn
}

// LifecycleManagement returns the lifecycle block for [Resource].
func (af *Resource) LifecycleManagement() *terra.Lifecycle {
return af.Lifecycle
}

// Attributes returns the attributes for [Resource].
func (af *Resource) Attributes() archiveFileAttributes {
return archiveFileAttributes{ref: terra.ReferenceResource(af)}
}

// ImportState imports the given attribute values into [Resource]'s state.
func (af *Resource) ImportState(state io.Reader) error {
af.state = &archiveFileState{}
if err := json.NewDecoder(state).Decode(af.state); err != nil {
return fmt.Errorf("decoding state into resource %s.%s: %w", af.Type(), af.LocalName(), err)
}
return nil
}

// State returns the state and a bool indicating if [Resource] has state.
func (af *Resource) State() (*archiveFileState, bool) {
return af.state, af.state != nil
}

// StateMust returns the state for [Resource]. Panics if the state is nil.
func (af *Resource) StateMust() *archiveFileState {
if af.state == nil {
panic(fmt.Sprintf("state is nil for resource %s.%s", af.Type(), af.LocalName()))
}
return af.state
}

// Args contains the configurations for archive_file.
type Args struct {
// ExcludeSymlinkDirectories: bool, optional
ExcludeSymlinkDirectories terra.BoolValue `hcl:"exclude_symlink_directories,attr"`
// Excludes: set of string, optional
Excludes terra.SetValue[terra.StringValue] `hcl:"excludes,attr"`
// OutputFileMode: string, optional
OutputFileMode terra.StringValue `hcl:"output_file_mode,attr"`
// OutputPath: string, required
OutputPath terra.StringValue `hcl:"output_path,attr" validate:"required"`
// SourceContent: string, optional
SourceContent terra.StringValue `hcl:"source_content,attr"`
// SourceContentFilename: string, optional
SourceContentFilename terra.StringValue `hcl:"source_content_filename,attr"`
// SourceDir: string, optional
SourceDir terra.StringValue `hcl:"source_dir,attr"`
// SourceFile: string, optional
SourceFile terra.StringValue `hcl:"source_file,attr"`
// Type: string, required
Type terra.StringValue `hcl:"type,attr" validate:"required"`
// Source: min=0
Source []Source `hcl:"source,block" validate:"min=0"`
}

type archiveFileAttributes struct {
ref terra.Reference
}

// ExcludeSymlinkDirectories returns a reference to field exclude_symlink_directories of archive_file.
func (af archiveFileAttributes) ExcludeSymlinkDirectories() terra.BoolValue {
return terra.ReferenceAsBool(af.ref.Append("exclude_symlink_directories"))
}

// Excludes returns a reference to field excludes of archive_file.
func (af archiveFileAttributes) Excludes() terra.SetValue[terra.StringValue] {
return terra.ReferenceAsSet[terra.StringValue](af.ref.Append("excludes"))
}

// Id returns a reference to field id of archive_file.
func (af archiveFileAttributes) Id() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("id"))
}

// OutputBase64Sha256 returns a reference to field output_base64sha256 of archive_file.
func (af archiveFileAttributes) OutputBase64Sha256() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("output_base64sha256"))
}

// OutputBase64Sha512 returns a reference to field output_base64sha512 of archive_file.
func (af archiveFileAttributes) OutputBase64Sha512() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("output_base64sha512"))
}

// OutputFileMode returns a reference to field output_file_mode of archive_file.
func (af archiveFileAttributes) OutputFileMode() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("output_file_mode"))
}

// OutputMd5 returns a reference to field output_md5 of archive_file.
func (af archiveFileAttributes) OutputMd5() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("output_md5"))
}

// OutputPath returns a reference to field output_path of archive_file.
func (af archiveFileAttributes) OutputPath() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("output_path"))
}

// OutputSha returns a reference to field output_sha of archive_file.
func (af archiveFileAttributes) OutputSha() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("output_sha"))
}

// OutputSha256 returns a reference to field output_sha256 of archive_file.
func (af archiveFileAttributes) OutputSha256() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("output_sha256"))
}

// OutputSha512 returns a reference to field output_sha512 of archive_file.
func (af archiveFileAttributes) OutputSha512() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("output_sha512"))
}

// OutputSize returns a reference to field output_size of archive_file.
func (af archiveFileAttributes) OutputSize() terra.NumberValue {
return terra.ReferenceAsNumber(af.ref.Append("output_size"))
}

// SourceContent returns a reference to field source_content of archive_file.
func (af archiveFileAttributes) SourceContent() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("source_content"))
}

// SourceContentFilename returns a reference to field source_content_filename of archive_file.
func (af archiveFileAttributes) SourceContentFilename() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("source_content_filename"))
}

// SourceDir returns a reference to field source_dir of archive_file.
func (af archiveFileAttributes) SourceDir() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("source_dir"))
}

// SourceFile returns a reference to field source_file of archive_file.
func (af archiveFileAttributes) SourceFile() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("source_file"))
}

// Type returns a reference to field type of archive_file.
func (af archiveFileAttributes) Type() terra.StringValue {
return terra.ReferenceAsString(af.ref.Append("type"))
}

func (af archiveFileAttributes) Source() terra.SetValue[SourceAttributes] {
return terra.ReferenceAsSet[SourceAttributes](af.ref.Append("source"))
}

type archiveFileState struct {
ExcludeSymlinkDirectories bool `json:"exclude_symlink_directories"`
Excludes []string `json:"excludes"`
Id string `json:"id"`
OutputBase64Sha256 string `json:"output_base64sha256"`
OutputBase64Sha512 string `json:"output_base64sha512"`
OutputFileMode string `json:"output_file_mode"`
OutputMd5 string `json:"output_md5"`
OutputPath string `json:"output_path"`
OutputSha string `json:"output_sha"`
OutputSha256 string `json:"output_sha256"`
OutputSha512 string `json:"output_sha512"`
OutputSize float64 `json:"output_size"`
SourceContent string `json:"source_content"`
SourceContentFilename string `json:"source_content_filename"`
SourceDir string `json:"source_dir"`
SourceFile string `json:"source_file"`
Type string `json:"type"`
Source []SourceState `json:"source"`
}
44 changes: 44 additions & 0 deletions archive/2.4.2/archive_file/archive_file_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// CODE GENERATED BY github.com/golingon/lingon. DO NOT EDIT.

package archive_file

import (
terra "github.com/golingon/lingon/pkg/terra"
hclwrite "github.com/hashicorp/hcl/v2/hclwrite"
)

type Source struct {
// Content: string, required
Content terra.StringValue `hcl:"content,attr" validate:"required"`
// Filename: string, required
Filename terra.StringValue `hcl:"filename,attr" validate:"required"`
}

type SourceAttributes struct {
ref terra.Reference
}

func (s SourceAttributes) InternalRef() (terra.Reference, error) {
return s.ref, nil
}

func (s SourceAttributes) InternalWithRef(ref terra.Reference) SourceAttributes {
return SourceAttributes{ref: ref}
}

func (s SourceAttributes) InternalTokens() (hclwrite.Tokens, error) {
return s.ref.InternalTokens()
}

func (s SourceAttributes) Content() terra.StringValue {
return terra.ReferenceAsString(s.ref.Append("content"))
}

func (s SourceAttributes) Filename() terra.StringValue {
return terra.ReferenceAsString(s.ref.Append("filename"))
}

type SourceState struct {
Content string `json:"content"`
Filename string `json:"filename"`
}
Loading

0 comments on commit 4deecce

Please sign in to comment.