From 1d6cf1ef0b7f87f60abef8604137d1e51f5fc86e Mon Sep 17 00:00:00 2001 From: Ivan Sabelnikov Date: Mon, 30 Oct 2023 15:13:45 +0000 Subject: [PATCH] feat: Upgrade provider to 1.0.4 --- .../cmd/pulumi-resource-zitadel/schema.json | 17 ++++++ provider/go.mod | 2 +- provider/go.sum | 4 +- sdk/dotnet/GetOrg.cs | 7 +++ sdk/dotnet/Org.cs | 18 ++++++ sdk/go/zitadel/getOrg.go | 7 +++ sdk/go/zitadel/org.go | 15 +++++ sdk/nodejs/getOrg.ts | 4 ++ sdk/nodejs/org.ts | 14 +++++ sdk/python/pulumiverse_zitadel/get_org.py | 15 ++++- sdk/python/pulumiverse_zitadel/org.py | 55 +++++++++++++++++++ 11 files changed, 154 insertions(+), 4 deletions(-) diff --git a/provider/cmd/pulumi-resource-zitadel/schema.json b/provider/cmd/pulumi-resource-zitadel/schema.json index ff6625f..69450eb 100644 --- a/provider/cmd/pulumi-resource-zitadel/schema.json +++ b/provider/cmd/pulumi-resource-zitadel/schema.json @@ -4315,6 +4315,10 @@ "zitadel:index/org:Org": { "description": "Resource representing an organization in ZITADEL, which is the highest level after the instance and contains several other resource including policies if the configuration differs to the default policies on the instance.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as zitadel from \"@pulumiverse/zitadel\";\n\nconst _default = new zitadel.Org(\"default\", {});\n```\n```python\nimport pulumi\nimport pulumiverse_zitadel as zitadel\n\ndefault = zitadel.Org(\"default\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Zitadel = Pulumiverse.Zitadel;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var @default = new Zitadel.Org(\"default\");\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n\t\"github.com/pulumiverse/pulumi-zitadel/sdk/go/zitadel\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := zitadel.NewOrg(ctx, \"default\", nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.zitadel.Org;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var default_ = new Org(\"default\");\n\n }\n}\n```\n```yaml\nresources:\n default:\n type: zitadel:Org\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nterraform The resource can be imported using the ID format `\u003cid\u003e`, e.g.\n\n```sh\n $ pulumi import zitadel:index/org:Org imported '123456789012345678'\n```\n\n ", "properties": { + "isDefault": { + "type": "boolean", + "description": "True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org.\n" + }, "name": { "type": "string", "description": "Name of the org\n" @@ -4334,6 +4338,10 @@ "state" ], "inputProperties": { + "isDefault": { + "type": "boolean", + "description": "True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org.\n" + }, "name": { "type": "string", "description": "Name of the org\n" @@ -4342,6 +4350,10 @@ "stateInputs": { "description": "Input properties used for looking up and filtering Org resources.\n", "properties": { + "isDefault": { + "type": "boolean", + "description": "True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org.\n" + }, "name": { "type": "string", "description": "Name of the org\n" @@ -8378,6 +8390,10 @@ "type": "string", "description": "ID of the organization\n" }, + "isDefault": { + "type": "boolean", + "description": "Indicates whether the org is the default org of the instance.\n" + }, "name": { "type": "string", "description": "Name of the org.\n" @@ -8394,6 +8410,7 @@ "type": "object", "required": [ "id", + "isDefault", "name", "primaryDomain", "state" diff --git a/provider/go.mod b/provider/go.mod index a0009b5..055cd24 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -7,7 +7,7 @@ replace github.com/hashicorp/terraform-plugin-sdk/v2 => github.com/pulumi/terraf require ( github.com/pulumi/pulumi-terraform-bridge/v3 v3.62.0 github.com/pulumi/pulumi/sdk/v3 v3.89.0 - github.com/zitadel/terraform-provider-zitadel v1.0.3 + github.com/zitadel/terraform-provider-zitadel v1.0.4 ) require ( diff --git a/provider/go.sum b/provider/go.sum index 355519f..de29b1a 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -2437,8 +2437,8 @@ github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaD github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= github.com/zitadel/oidc v1.13.4 h1:+k2GKqP9Ld9S2MSFlj+KaNsoZ3J9oy+Ezw51EzSFuC8= github.com/zitadel/oidc v1.13.4/go.mod h1:3h2DhUcP02YV6q/CA/BG4yla0o6rXjK+DkJGK/dwJfw= -github.com/zitadel/terraform-provider-zitadel v1.0.3 h1:fsky0W/dSW5or8rbsQcF/7bZntQaeGxsul5d1hOEwM0= -github.com/zitadel/terraform-provider-zitadel v1.0.3/go.mod h1:6AHXpHOu0B6O2lNavJiiyoOKB4T10IUlNZdIaO1Tzz8= +github.com/zitadel/terraform-provider-zitadel v1.0.4 h1:fv2X0nueuUfyYy+uYwLHsBbvNeAfTeYlQyFJX/A9KbY= +github.com/zitadel/terraform-provider-zitadel v1.0.4/go.mod h1:6AHXpHOu0B6O2lNavJiiyoOKB4T10IUlNZdIaO1Tzz8= github.com/zitadel/zitadel-go/v2 v2.0.21 h1:P+m8rBReph8UhxrchSR0npthHTlwqmVHi8k8JI1q1ds= github.com/zitadel/zitadel-go/v2 v2.0.21/go.mod h1:1kHc4fpCjAHVAA13bZNrpxaAO83VaPnF8rzM157A9rQ= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= diff --git a/sdk/dotnet/GetOrg.cs b/sdk/dotnet/GetOrg.cs index 255fea0..7fcbf2a 100644 --- a/sdk/dotnet/GetOrg.cs +++ b/sdk/dotnet/GetOrg.cs @@ -115,6 +115,10 @@ public sealed class GetOrgResult /// public readonly string Id; /// + /// Indicates whether the org is the default org of the instance. + /// + public readonly bool IsDefault; + /// /// Name of the org. /// public readonly string Name; @@ -131,6 +135,8 @@ public sealed class GetOrgResult private GetOrgResult( string id, + bool isDefault, + string name, string primaryDomain, @@ -138,6 +144,7 @@ private GetOrgResult( string state) { Id = id; + IsDefault = isDefault; Name = name; PrimaryDomain = primaryDomain; State = state; diff --git a/sdk/dotnet/Org.cs b/sdk/dotnet/Org.cs index 6d1557f..0643f36 100644 --- a/sdk/dotnet/Org.cs +++ b/sdk/dotnet/Org.cs @@ -39,6 +39,12 @@ namespace Pulumiverse.Zitadel [ZitadelResourceType("zitadel:index/org:Org")] public partial class Org : global::Pulumi.CustomResource { + /// + /// True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + /// + [Output("isDefault")] + public Output IsDefault { get; private set; } = null!; + /// /// Name of the org /// @@ -104,6 +110,12 @@ public static Org Get(string name, Input id, OrgState? state = null, Cus public sealed class OrgArgs : global::Pulumi.ResourceArgs { + /// + /// True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + /// + [Input("isDefault")] + public Input? IsDefault { get; set; } + /// /// Name of the org /// @@ -118,6 +130,12 @@ public OrgArgs() public sealed class OrgState : global::Pulumi.ResourceArgs { + /// + /// True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + /// + [Input("isDefault")] + public Input? IsDefault { get; set; } + /// /// Name of the org /// diff --git a/sdk/go/zitadel/getOrg.go b/sdk/go/zitadel/getOrg.go index 246ed88..b705d4f 100644 --- a/sdk/go/zitadel/getOrg.go +++ b/sdk/go/zitadel/getOrg.go @@ -60,6 +60,8 @@ type LookupOrgArgs struct { type LookupOrgResult struct { // ID of the organization Id string `pulumi:"id"` + // Indicates whether the org is the default org of the instance. + IsDefault bool `pulumi:"isDefault"` // Name of the org. Name string `pulumi:"name"` // Primary domain of the org @@ -117,6 +119,11 @@ func (o LookupOrgResultOutput) Id() pulumi.StringOutput { return o.ApplyT(func(v LookupOrgResult) string { return v.Id }).(pulumi.StringOutput) } +// Indicates whether the org is the default org of the instance. +func (o LookupOrgResultOutput) IsDefault() pulumi.BoolOutput { + return o.ApplyT(func(v LookupOrgResult) bool { return v.IsDefault }).(pulumi.BoolOutput) +} + // Name of the org. func (o LookupOrgResultOutput) Name() pulumi.StringOutput { return o.ApplyT(func(v LookupOrgResult) string { return v.Name }).(pulumi.StringOutput) diff --git a/sdk/go/zitadel/org.go b/sdk/go/zitadel/org.go index 1e64b4f..638c308 100644 --- a/sdk/go/zitadel/org.go +++ b/sdk/go/zitadel/org.go @@ -50,6 +50,8 @@ import ( type Org struct { pulumi.CustomResourceState + // True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + IsDefault pulumi.BoolPtrOutput `pulumi:"isDefault"` // Name of the org Name pulumi.StringOutput `pulumi:"name"` // Primary domain of the org @@ -88,6 +90,8 @@ func GetOrg(ctx *pulumi.Context, // Input properties used for looking up and filtering Org resources. type orgState struct { + // True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + IsDefault *bool `pulumi:"isDefault"` // Name of the org Name *string `pulumi:"name"` // Primary domain of the org @@ -97,6 +101,8 @@ type orgState struct { } type OrgState struct { + // True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + IsDefault pulumi.BoolPtrInput // Name of the org Name pulumi.StringPtrInput // Primary domain of the org @@ -110,12 +116,16 @@ func (OrgState) ElementType() reflect.Type { } type orgArgs struct { + // True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + IsDefault *bool `pulumi:"isDefault"` // Name of the org Name *string `pulumi:"name"` } // The set of arguments for constructing a Org resource. type OrgArgs struct { + // True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + IsDefault pulumi.BoolPtrInput // Name of the org Name pulumi.StringPtrInput } @@ -231,6 +241,11 @@ func (o OrgOutput) ToOutput(ctx context.Context) pulumix.Output[*Org] { } } +// True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. +func (o OrgOutput) IsDefault() pulumi.BoolPtrOutput { + return o.ApplyT(func(v *Org) pulumi.BoolPtrOutput { return v.IsDefault }).(pulumi.BoolPtrOutput) +} + // Name of the org func (o OrgOutput) Name() pulumi.StringOutput { return o.ApplyT(func(v *Org) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) diff --git a/sdk/nodejs/getOrg.ts b/sdk/nodejs/getOrg.ts index 74b5cd8..cdd4ffe 100644 --- a/sdk/nodejs/getOrg.ts +++ b/sdk/nodejs/getOrg.ts @@ -45,6 +45,10 @@ export interface GetOrgResult { * ID of the organization */ readonly id: string; + /** + * Indicates whether the org is the default org of the instance. + */ + readonly isDefault: boolean; /** * Name of the org. */ diff --git a/sdk/nodejs/org.ts b/sdk/nodejs/org.ts index 91eb006..ada7f39 100644 --- a/sdk/nodejs/org.ts +++ b/sdk/nodejs/org.ts @@ -52,6 +52,10 @@ export class Org extends pulumi.CustomResource { return obj['__pulumiType'] === Org.__pulumiType; } + /** + * True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + */ + public readonly isDefault!: pulumi.Output; /** * Name of the org */ @@ -78,11 +82,13 @@ export class Org extends pulumi.CustomResource { opts = opts || {}; if (opts.id) { const state = argsOrState as OrgState | undefined; + resourceInputs["isDefault"] = state ? state.isDefault : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["primaryDomain"] = state ? state.primaryDomain : undefined; resourceInputs["state"] = state ? state.state : undefined; } else { const args = argsOrState as OrgArgs | undefined; + resourceInputs["isDefault"] = args ? args.isDefault : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["primaryDomain"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; @@ -96,6 +102,10 @@ export class Org extends pulumi.CustomResource { * Input properties used for looking up and filtering Org resources. */ export interface OrgState { + /** + * True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + */ + isDefault?: pulumi.Input; /** * Name of the org */ @@ -114,6 +124,10 @@ export interface OrgState { * The set of arguments for constructing a Org resource. */ export interface OrgArgs { + /** + * True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + */ + isDefault?: pulumi.Input; /** * Name of the org */ diff --git a/sdk/python/pulumiverse_zitadel/get_org.py b/sdk/python/pulumiverse_zitadel/get_org.py index e7cbfbf..4c4bae5 100644 --- a/sdk/python/pulumiverse_zitadel/get_org.py +++ b/sdk/python/pulumiverse_zitadel/get_org.py @@ -21,10 +21,13 @@ class GetOrgResult: """ A collection of values returned by getOrg. """ - def __init__(__self__, id=None, name=None, primary_domain=None, state=None): + def __init__(__self__, id=None, is_default=None, name=None, primary_domain=None, state=None): if id and not isinstance(id, str): raise TypeError("Expected argument 'id' to be a str") pulumi.set(__self__, "id", id) + if is_default and not isinstance(is_default, bool): + raise TypeError("Expected argument 'is_default' to be a bool") + pulumi.set(__self__, "is_default", is_default) if name and not isinstance(name, str): raise TypeError("Expected argument 'name' to be a str") pulumi.set(__self__, "name", name) @@ -43,6 +46,14 @@ def id(self) -> str: """ return pulumi.get(self, "id") + @property + @pulumi.getter(name="isDefault") + def is_default(self) -> bool: + """ + Indicates whether the org is the default org of the instance. + """ + return pulumi.get(self, "is_default") + @property @pulumi.getter def name(self) -> str: @@ -75,6 +86,7 @@ def __await__(self): yield self return GetOrgResult( id=self.id, + is_default=self.is_default, name=self.name, primary_domain=self.primary_domain, state=self.state) @@ -105,6 +117,7 @@ def get_org(id: Optional[str] = None, return AwaitableGetOrgResult( id=pulumi.get(__ret__, 'id'), + is_default=pulumi.get(__ret__, 'is_default'), name=pulumi.get(__ret__, 'name'), primary_domain=pulumi.get(__ret__, 'primary_domain'), state=pulumi.get(__ret__, 'state')) diff --git a/sdk/python/pulumiverse_zitadel/org.py b/sdk/python/pulumiverse_zitadel/org.py index 410b84c..6144b4a 100644 --- a/sdk/python/pulumiverse_zitadel/org.py +++ b/sdk/python/pulumiverse_zitadel/org.py @@ -14,25 +14,45 @@ @pulumi.input_type class OrgArgs: def __init__(__self__, *, + is_default: Optional[pulumi.Input[bool]] = None, name: Optional[pulumi.Input[str]] = None): """ The set of arguments for constructing a Org resource. + :param pulumi.Input[bool] is_default: True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. :param pulumi.Input[str] name: Name of the org """ OrgArgs._configure( lambda key, value: pulumi.set(__self__, key, value), + is_default=is_default, name=name, ) @staticmethod def _configure( _setter: Callable[[Any, Any], None], + is_default: Optional[pulumi.Input[bool]] = None, name: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.ResourceOptions]=None, **kwargs): + if 'isDefault' in kwargs: + is_default = kwargs['isDefault'] + if is_default is not None: + _setter("is_default", is_default) if name is not None: _setter("name", name) + @property + @pulumi.getter(name="isDefault") + def is_default(self) -> Optional[pulumi.Input[bool]]: + """ + True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + """ + return pulumi.get(self, "is_default") + + @is_default.setter + def is_default(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "is_default", value) + @property @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: @@ -49,17 +69,20 @@ def name(self, value: Optional[pulumi.Input[str]]): @pulumi.input_type class _OrgState: def __init__(__self__, *, + is_default: Optional[pulumi.Input[bool]] = None, name: Optional[pulumi.Input[str]] = None, primary_domain: Optional[pulumi.Input[str]] = None, state: Optional[pulumi.Input[str]] = None): """ Input properties used for looking up and filtering Org resources. + :param pulumi.Input[bool] is_default: True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. :param pulumi.Input[str] name: Name of the org :param pulumi.Input[str] primary_domain: Primary domain of the org :param pulumi.Input[str] state: State of the org """ _OrgState._configure( lambda key, value: pulumi.set(__self__, key, value), + is_default=is_default, name=name, primary_domain=primary_domain, state=state, @@ -67,14 +90,19 @@ def __init__(__self__, *, @staticmethod def _configure( _setter: Callable[[Any, Any], None], + is_default: Optional[pulumi.Input[bool]] = None, name: Optional[pulumi.Input[str]] = None, primary_domain: Optional[pulumi.Input[str]] = None, state: Optional[pulumi.Input[str]] = None, opts: Optional[pulumi.ResourceOptions]=None, **kwargs): + if 'isDefault' in kwargs: + is_default = kwargs['isDefault'] if 'primaryDomain' in kwargs: primary_domain = kwargs['primaryDomain'] + if is_default is not None: + _setter("is_default", is_default) if name is not None: _setter("name", name) if primary_domain is not None: @@ -82,6 +110,18 @@ def _configure( if state is not None: _setter("state", state) + @property + @pulumi.getter(name="isDefault") + def is_default(self) -> Optional[pulumi.Input[bool]]: + """ + True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + """ + return pulumi.get(self, "is_default") + + @is_default.setter + def is_default(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "is_default", value) + @property @pulumi.getter def name(self) -> Optional[pulumi.Input[str]]: @@ -124,6 +164,7 @@ class Org(pulumi.CustomResource): def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, + is_default: Optional[pulumi.Input[bool]] = None, name: Optional[pulumi.Input[str]] = None, __props__=None): """ @@ -148,6 +189,7 @@ def __init__(__self__, :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[bool] is_default: True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. :param pulumi.Input[str] name: Name of the org """ ... @@ -195,6 +237,7 @@ def _setter(key, value): def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, + is_default: Optional[pulumi.Input[bool]] = None, name: Optional[pulumi.Input[str]] = None, __props__=None): opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) @@ -205,6 +248,7 @@ def _internal_init(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = OrgArgs.__new__(OrgArgs) + __props__.__dict__["is_default"] = is_default __props__.__dict__["name"] = name __props__.__dict__["primary_domain"] = None __props__.__dict__["state"] = None @@ -218,6 +262,7 @@ def _internal_init(__self__, def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions] = None, + is_default: Optional[pulumi.Input[bool]] = None, name: Optional[pulumi.Input[str]] = None, primary_domain: Optional[pulumi.Input[str]] = None, state: Optional[pulumi.Input[str]] = None) -> 'Org': @@ -228,6 +273,7 @@ def get(resource_name: str, :param str resource_name: The unique name of the resulting resource. :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[bool] is_default: True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. :param pulumi.Input[str] name: Name of the org :param pulumi.Input[str] primary_domain: Primary domain of the org :param pulumi.Input[str] state: State of the org @@ -236,11 +282,20 @@ def get(resource_name: str, __props__ = _OrgState.__new__(_OrgState) + __props__.__dict__["is_default"] = is_default __props__.__dict__["name"] = name __props__.__dict__["primary_domain"] = primary_domain __props__.__dict__["state"] = state return Org(resource_name, opts=opts, __props__=__props__) + @property + @pulumi.getter(name="isDefault") + def is_default(self) -> pulumi.Output[Optional[bool]]: + """ + True sets the org as default org for the instance. Only one org can be default org. Nothing happens if you set it to false until you set another org as default org. + """ + return pulumi.get(self, "is_default") + @property @pulumi.getter def name(self) -> pulumi.Output[str]: