|
| 1 | +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** |
| 2 | +// *** Do not edit by hand unless you're certain you know what you are doing! *** |
| 3 | + |
| 4 | +using System; |
| 5 | +using System.Collections.Generic; |
| 6 | +using System.Collections.Immutable; |
| 7 | +using System.Threading.Tasks; |
| 8 | +using Pulumi.Serialization; |
| 9 | + |
| 10 | +namespace Pulumi.PostgreSql |
| 11 | +{ |
| 12 | + public static class GetSchemas |
| 13 | + { |
| 14 | + /// <summary> |
| 15 | + /// The ``postgresql.getSchemas`` data source retrieves a list of schema names from a specified PostgreSQL database. |
| 16 | + /// |
| 17 | + /// |
| 18 | + /// ## Usage |
| 19 | + /// |
| 20 | + /// ```csharp |
| 21 | + /// using System.Collections.Generic; |
| 22 | + /// using Pulumi; |
| 23 | + /// using PostgreSql = Pulumi.PostgreSql; |
| 24 | + /// |
| 25 | + /// return await Deployment.RunAsync(() => |
| 26 | + /// { |
| 27 | + /// var mySchemas = PostgreSql.GetSchemas.Invoke(new() |
| 28 | + /// { |
| 29 | + /// Database = "my_database", |
| 30 | + /// }); |
| 31 | + /// |
| 32 | + /// }); |
| 33 | + /// ``` |
| 34 | + /// </summary> |
| 35 | + public static Task<GetSchemasResult> InvokeAsync(GetSchemasArgs args, InvokeOptions? options = null) |
| 36 | + => global::Pulumi.Deployment.Instance.InvokeAsync<GetSchemasResult>("postgresql:index/getSchemas:getSchemas", args ?? new GetSchemasArgs(), options.WithDefaults()); |
| 37 | + |
| 38 | + /// <summary> |
| 39 | + /// The ``postgresql.getSchemas`` data source retrieves a list of schema names from a specified PostgreSQL database. |
| 40 | + /// |
| 41 | + /// |
| 42 | + /// ## Usage |
| 43 | + /// |
| 44 | + /// ```csharp |
| 45 | + /// using System.Collections.Generic; |
| 46 | + /// using Pulumi; |
| 47 | + /// using PostgreSql = Pulumi.PostgreSql; |
| 48 | + /// |
| 49 | + /// return await Deployment.RunAsync(() => |
| 50 | + /// { |
| 51 | + /// var mySchemas = PostgreSql.GetSchemas.Invoke(new() |
| 52 | + /// { |
| 53 | + /// Database = "my_database", |
| 54 | + /// }); |
| 55 | + /// |
| 56 | + /// }); |
| 57 | + /// ``` |
| 58 | + /// </summary> |
| 59 | + public static Output<GetSchemasResult> Invoke(GetSchemasInvokeArgs args, InvokeOptions? options = null) |
| 60 | + => global::Pulumi.Deployment.Instance.Invoke<GetSchemasResult>("postgresql:index/getSchemas:getSchemas", args ?? new GetSchemasInvokeArgs(), options.WithDefaults()); |
| 61 | + } |
| 62 | + |
| 63 | + |
| 64 | + public sealed class GetSchemasArgs : global::Pulumi.InvokeArgs |
| 65 | + { |
| 66 | + /// <summary> |
| 67 | + /// The PostgreSQL database which will be queried for schema names. |
| 68 | + /// </summary> |
| 69 | + [Input("database", required: true)] |
| 70 | + public string Database { get; set; } = null!; |
| 71 | + |
| 72 | + /// <summary> |
| 73 | + /// Determines whether to include system schemas (pg_ prefix and information_schema). 'public' will always be included. Defaults to ``false``. |
| 74 | + /// </summary> |
| 75 | + [Input("includeSystemSchemas")] |
| 76 | + public bool? IncludeSystemSchemas { get; set; } |
| 77 | + |
| 78 | + [Input("likeAllPatterns")] |
| 79 | + private List<string>? _likeAllPatterns; |
| 80 | + |
| 81 | + /// <summary> |
| 82 | + /// List of expressions which will be pattern matched in the query using the PostgreSQL ``LIKE ALL`` operators. |
| 83 | + /// </summary> |
| 84 | + public List<string> LikeAllPatterns |
| 85 | + { |
| 86 | + get => _likeAllPatterns ?? (_likeAllPatterns = new List<string>()); |
| 87 | + set => _likeAllPatterns = value; |
| 88 | + } |
| 89 | + |
| 90 | + [Input("likeAnyPatterns")] |
| 91 | + private List<string>? _likeAnyPatterns; |
| 92 | + |
| 93 | + /// <summary> |
| 94 | + /// List of expressions which will be pattern matched in the query using the PostgreSQL ``LIKE ANY`` operators. |
| 95 | + /// </summary> |
| 96 | + public List<string> LikeAnyPatterns |
| 97 | + { |
| 98 | + get => _likeAnyPatterns ?? (_likeAnyPatterns = new List<string>()); |
| 99 | + set => _likeAnyPatterns = value; |
| 100 | + } |
| 101 | + |
| 102 | + [Input("notLikeAllPatterns")] |
| 103 | + private List<string>? _notLikeAllPatterns; |
| 104 | + |
| 105 | + /// <summary> |
| 106 | + /// List of expressions which will be pattern matched in the query using the PostgreSQL ``NOT LIKE ALL`` operators. |
| 107 | + /// </summary> |
| 108 | + public List<string> NotLikeAllPatterns |
| 109 | + { |
| 110 | + get => _notLikeAllPatterns ?? (_notLikeAllPatterns = new List<string>()); |
| 111 | + set => _notLikeAllPatterns = value; |
| 112 | + } |
| 113 | + |
| 114 | + /// <summary> |
| 115 | + /// Expression which will be pattern matched in the query using the PostgreSQL ``~`` (regular expression match) operator. |
| 116 | + /// </summary> |
| 117 | + [Input("regexPattern")] |
| 118 | + public string? RegexPattern { get; set; } |
| 119 | + |
| 120 | + public GetSchemasArgs() |
| 121 | + { |
| 122 | + } |
| 123 | + public static new GetSchemasArgs Empty => new GetSchemasArgs(); |
| 124 | + } |
| 125 | + |
| 126 | + public sealed class GetSchemasInvokeArgs : global::Pulumi.InvokeArgs |
| 127 | + { |
| 128 | + /// <summary> |
| 129 | + /// The PostgreSQL database which will be queried for schema names. |
| 130 | + /// </summary> |
| 131 | + [Input("database", required: true)] |
| 132 | + public Input<string> Database { get; set; } = null!; |
| 133 | + |
| 134 | + /// <summary> |
| 135 | + /// Determines whether to include system schemas (pg_ prefix and information_schema). 'public' will always be included. Defaults to ``false``. |
| 136 | + /// </summary> |
| 137 | + [Input("includeSystemSchemas")] |
| 138 | + public Input<bool>? IncludeSystemSchemas { get; set; } |
| 139 | + |
| 140 | + [Input("likeAllPatterns")] |
| 141 | + private InputList<string>? _likeAllPatterns; |
| 142 | + |
| 143 | + /// <summary> |
| 144 | + /// List of expressions which will be pattern matched in the query using the PostgreSQL ``LIKE ALL`` operators. |
| 145 | + /// </summary> |
| 146 | + public InputList<string> LikeAllPatterns |
| 147 | + { |
| 148 | + get => _likeAllPatterns ?? (_likeAllPatterns = new InputList<string>()); |
| 149 | + set => _likeAllPatterns = value; |
| 150 | + } |
| 151 | + |
| 152 | + [Input("likeAnyPatterns")] |
| 153 | + private InputList<string>? _likeAnyPatterns; |
| 154 | + |
| 155 | + /// <summary> |
| 156 | + /// List of expressions which will be pattern matched in the query using the PostgreSQL ``LIKE ANY`` operators. |
| 157 | + /// </summary> |
| 158 | + public InputList<string> LikeAnyPatterns |
| 159 | + { |
| 160 | + get => _likeAnyPatterns ?? (_likeAnyPatterns = new InputList<string>()); |
| 161 | + set => _likeAnyPatterns = value; |
| 162 | + } |
| 163 | + |
| 164 | + [Input("notLikeAllPatterns")] |
| 165 | + private InputList<string>? _notLikeAllPatterns; |
| 166 | + |
| 167 | + /// <summary> |
| 168 | + /// List of expressions which will be pattern matched in the query using the PostgreSQL ``NOT LIKE ALL`` operators. |
| 169 | + /// </summary> |
| 170 | + public InputList<string> NotLikeAllPatterns |
| 171 | + { |
| 172 | + get => _notLikeAllPatterns ?? (_notLikeAllPatterns = new InputList<string>()); |
| 173 | + set => _notLikeAllPatterns = value; |
| 174 | + } |
| 175 | + |
| 176 | + /// <summary> |
| 177 | + /// Expression which will be pattern matched in the query using the PostgreSQL ``~`` (regular expression match) operator. |
| 178 | + /// </summary> |
| 179 | + [Input("regexPattern")] |
| 180 | + public Input<string>? RegexPattern { get; set; } |
| 181 | + |
| 182 | + public GetSchemasInvokeArgs() |
| 183 | + { |
| 184 | + } |
| 185 | + public static new GetSchemasInvokeArgs Empty => new GetSchemasInvokeArgs(); |
| 186 | + } |
| 187 | + |
| 188 | + |
| 189 | + [OutputType] |
| 190 | + public sealed class GetSchemasResult |
| 191 | + { |
| 192 | + public readonly string Database; |
| 193 | + /// <summary> |
| 194 | + /// The provider-assigned unique ID for this managed resource. |
| 195 | + /// </summary> |
| 196 | + public readonly string Id; |
| 197 | + public readonly bool? IncludeSystemSchemas; |
| 198 | + public readonly ImmutableArray<string> LikeAllPatterns; |
| 199 | + public readonly ImmutableArray<string> LikeAnyPatterns; |
| 200 | + public readonly ImmutableArray<string> NotLikeAllPatterns; |
| 201 | + public readonly string? RegexPattern; |
| 202 | + /// <summary> |
| 203 | + /// A list of full names of found schemas. |
| 204 | + /// </summary> |
| 205 | + public readonly ImmutableArray<string> Schemas; |
| 206 | + |
| 207 | + [OutputConstructor] |
| 208 | + private GetSchemasResult( |
| 209 | + string database, |
| 210 | + |
| 211 | + string id, |
| 212 | + |
| 213 | + bool? includeSystemSchemas, |
| 214 | + |
| 215 | + ImmutableArray<string> likeAllPatterns, |
| 216 | + |
| 217 | + ImmutableArray<string> likeAnyPatterns, |
| 218 | + |
| 219 | + ImmutableArray<string> notLikeAllPatterns, |
| 220 | + |
| 221 | + string? regexPattern, |
| 222 | + |
| 223 | + ImmutableArray<string> schemas) |
| 224 | + { |
| 225 | + Database = database; |
| 226 | + Id = id; |
| 227 | + IncludeSystemSchemas = includeSystemSchemas; |
| 228 | + LikeAllPatterns = likeAllPatterns; |
| 229 | + LikeAnyPatterns = likeAnyPatterns; |
| 230 | + NotLikeAllPatterns = notLikeAllPatterns; |
| 231 | + RegexPattern = regexPattern; |
| 232 | + Schemas = schemas; |
| 233 | + } |
| 234 | + } |
| 235 | +} |
0 commit comments