-
Notifications
You must be signed in to change notification settings - Fork 2
/
kafkaSchema.go
128 lines (114 loc) · 4.03 KB
/
kafkaSchema.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package aiven
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
type KafkaSchema struct {
s *pulumi.ResourceState
}
// NewKafkaSchema registers a new resource with the given unique name, arguments, and options.
func NewKafkaSchema(ctx *pulumi.Context,
name string, args *KafkaSchemaArgs, opts ...pulumi.ResourceOpt) (*KafkaSchema, error) {
if args == nil || args.Project == nil {
return nil, errors.New("missing required argument 'Project'")
}
if args == nil || args.Schema == nil {
return nil, errors.New("missing required argument 'Schema'")
}
if args == nil || args.ServiceName == nil {
return nil, errors.New("missing required argument 'ServiceName'")
}
if args == nil || args.SubjectName == nil {
return nil, errors.New("missing required argument 'SubjectName'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["project"] = nil
inputs["schema"] = nil
inputs["serviceName"] = nil
inputs["subjectName"] = nil
} else {
inputs["project"] = args.Project
inputs["schema"] = args.Schema
inputs["serviceName"] = args.ServiceName
inputs["subjectName"] = args.SubjectName
}
inputs["version"] = nil
s, err := ctx.RegisterResource("aiven:index/kafkaSchema:KafkaSchema", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &KafkaSchema{s: s}, nil
}
// GetKafkaSchema gets an existing KafkaSchema resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetKafkaSchema(ctx *pulumi.Context,
name string, id pulumi.ID, state *KafkaSchemaState, opts ...pulumi.ResourceOpt) (*KafkaSchema, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["project"] = state.Project
inputs["schema"] = state.Schema
inputs["serviceName"] = state.ServiceName
inputs["subjectName"] = state.SubjectName
inputs["version"] = state.Version
}
s, err := ctx.ReadResource("aiven:index/kafkaSchema:KafkaSchema", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &KafkaSchema{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *KafkaSchema) URN() pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *KafkaSchema) ID() pulumi.IDOutput {
return r.s.ID()
}
// Project to link the Kafka Schema to
func (r *KafkaSchema) Project() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["project"])
}
// Kafka Schema configuration should be a valid Avro Schema JSON format
func (r *KafkaSchema) Schema() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["schema"])
}
// Service to link the Kafka Schema to
func (r *KafkaSchema) ServiceName() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["serviceName"])
}
// Kafka Schema Subject name
func (r *KafkaSchema) SubjectName() pulumi.StringOutput {
return (pulumi.StringOutput)(r.s.State["subjectName"])
}
// Kafka Schema configuration version
func (r *KafkaSchema) Version() pulumi.IntOutput {
return (pulumi.IntOutput)(r.s.State["version"])
}
// Input properties used for looking up and filtering KafkaSchema resources.
type KafkaSchemaState struct {
// Project to link the Kafka Schema to
Project interface{}
// Kafka Schema configuration should be a valid Avro Schema JSON format
Schema interface{}
// Service to link the Kafka Schema to
ServiceName interface{}
// Kafka Schema Subject name
SubjectName interface{}
// Kafka Schema configuration version
Version interface{}
}
// The set of arguments for constructing a KafkaSchema resource.
type KafkaSchemaArgs struct {
// Project to link the Kafka Schema to
Project interface{}
// Kafka Schema configuration should be a valid Avro Schema JSON format
Schema interface{}
// Service to link the Kafka Schema to
ServiceName interface{}
// Kafka Schema Subject name
SubjectName interface{}
}