Skip to content

Commit

Permalink
fixup! generate examples from terraform examples upstream
Browse files Browse the repository at this point in the history
Signed-off-by: Oscar Cobles <[email protected]>
  • Loading branch information
Oscar Cobles committed Jul 12, 2024
1 parent a043f39 commit e09b2e3
Show file tree
Hide file tree
Showing 1,636 changed files with 368,846 additions and 721 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,19 @@ development: install_plugins provider lint_provider build_sdks install_sdks clea
build: install_plugins provider build_sdks install_sdks
only_build: build

tfgen: cleanup install_plugins upstream examples
tfgen: install_plugins upstream
(cd provider && go build -o $(WORKING_DIR)/bin/${TFGEN} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" ${PROJECT}/${PROVIDER_PATH}/cmd/${TFGEN})
$(WORKING_DIR)/bin/${TFGEN} schema --out provider/cmd/${PROVIDER}
(cd provider && VERSION=$(VERSION) go generate cmd/${PROVIDER}/main.go)

tfgen: examples

bin/pulumi-java-gen: .pulumi-java-gen.version
pulumictl download-binary -n pulumi-language-java -v v$(shell cat .pulumi-java-gen.version) -r pulumi/pulumi-java

provider: tfgen install_plugins # build the provider binary
provider: only_provider

only_provider:
(cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION} -X github.com/equinix/terraform-provider-equinix/version.ProviderVersion=${VERSION}" ${PROJECT}/${PROVIDER_PATH}/cmd/${PROVIDER})

build_sdks: clean build_nodejs build_python build_go build_dotnet build_java # build all the sdks
Expand Down Expand Up @@ -147,7 +150,7 @@ help:
clean:
rm -rf sdk/{dotnet,nodejs,go,python,java}

install_equinix_plugin: provider uninstall_equinix_plugin
install_equinix_plugin: only_provider uninstall_equinix_plugin
.pulumi/bin/pulumi plugin install resource equinix $(shell pulumictl get version --language generic) --file $(WORKING_DIR)/bin/$(PROVIDER)

uninstall_equinix_plugin: provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pulumi" Version="3.*" />
<PackageReference Include="Pulumi.Std" Version="1.7.2" />
<PackageReference Include="Pulumi.Equinix" Version="(, 1.0.0)" />
<PackageReference Include="Pulumi.Std" Version="1.7.2" />
</ItemGroup>

</Project>
133 changes: 133 additions & 0 deletions sdk/dotnet/Config/Config.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
// *** 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! ***

using System;
using System.Collections.Immutable;

namespace Pulumi.Equinix
{
public static class Config
{
[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "IDE1006", Justification =
"Double underscore prefix used to avoid conflicts with variable names.")]
private sealed class __Value<T>
{
private readonly Func<T> _getter;
private T _value = default!;
private bool _set;

public __Value(Func<T> getter)
{
_getter = getter;
}

public T Get() => _set ? _value : _getter();

public void Set(T value)
{
_value = value;
_set = true;
}
}

private static readonly global::Pulumi.Config __config = new global::Pulumi.Config("equinix");

private static readonly __Value<string?> _authToken = new __Value<string?>(() => __config.Get("authToken"));
/// <summary>
/// The Equinix Metal API auth key for API operations
/// </summary>
public static string? AuthToken
{
get => _authToken.Get();
set => _authToken.Set(value);
}

private static readonly __Value<string?> _clientId = new __Value<string?>(() => __config.Get("clientId"));
/// <summary>
/// API Consumer Key available under "My Apps" in developer portal. This argument can also be specified with the
/// `EQUINIX_API_CLIENTID` shell environment variable.
/// </summary>
public static string? ClientId
{
get => _clientId.Get();
set => _clientId.Set(value);
}

private static readonly __Value<string?> _clientSecret = new __Value<string?>(() => __config.Get("clientSecret"));
/// <summary>
/// API Consumer secret available under "My Apps" in developer portal. This argument can also be specified with the
/// `EQUINIX_API_CLIENTSECRET` shell environment variable.
/// </summary>
public static string? ClientSecret
{
get => _clientSecret.Get();
set => _clientSecret.Set(value);
}

private static readonly __Value<string?> _endpoint = new __Value<string?>(() => __config.Get("endpoint"));
/// <summary>
/// The Equinix API base URL to point out desired environment. This argument can also be specified with the
/// `EQUINIX_API_ENDPOINT` shell environment variable. (Defaults to `https://api.equinix.com`)
/// </summary>
public static string? Endpoint
{
get => _endpoint.Get();
set => _endpoint.Set(value);
}

private static readonly __Value<int?> _maxRetries = new __Value<int?>(() => __config.GetInt32("maxRetries"));
/// <summary>
/// Maximum number of retries in case of network failure.
/// </summary>
public static int? MaxRetries
{
get => _maxRetries.Get();
set => _maxRetries.Set(value);
}

private static readonly __Value<int?> _maxRetryWaitSeconds = new __Value<int?>(() => __config.GetInt32("maxRetryWaitSeconds"));
/// <summary>
/// Maximum number of seconds to wait before retrying a request.
/// </summary>
public static int? MaxRetryWaitSeconds
{
get => _maxRetryWaitSeconds.Get();
set => _maxRetryWaitSeconds.Set(value);
}

private static readonly __Value<int?> _requestTimeout = new __Value<int?>(() => __config.GetInt32("requestTimeout"));
/// <summary>
/// The duration of time, in seconds, that the Equinix Platform API Client should wait before canceling an API request.
/// Canceled requests may still result in provisioned resources. (Defaults to `30`)
/// </summary>
public static int? RequestTimeout
{
get => _requestTimeout.Get();
set => _requestTimeout.Set(value);
}

private static readonly __Value<int?> _responseMaxPageSize = new __Value<int?>(() => __config.GetInt32("responseMaxPageSize"));
/// <summary>
/// The maximum number of records in a single response for REST queries that produce paginated responses. (Default is client
/// specific)
/// </summary>
public static int? ResponseMaxPageSize
{
get => _responseMaxPageSize.Get();
set => _responseMaxPageSize.Set(value);
}

private static readonly __Value<string?> _token = new __Value<string?>(() => __config.Get("token"));
/// <summary>
/// API tokens are generated from API Consumer clients using the [OAuth2
/// API](https://developer.equinix.com/dev-docs/fabric/getting-started/getting-access-token#request-access-and-refresh-tokens).
/// This argument can also be specified with the `EQUINIX_API_TOKEN` shell environment variable.
/// </summary>
public static string? Token
{
get => _token.Get();
set => _token.Set(value);
}

}
}
1 change: 1 addition & 0 deletions sdk/dotnet/Config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A Pulumi package for creating and managing equinix cloud resources.
89 changes: 89 additions & 0 deletions sdk/dotnet/Enums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// *** 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! ***

using System;
using System.ComponentModel;
using Pulumi;

namespace Pulumi.Equinix
{
[EnumType]
public readonly struct Metro : IEquatable<Metro>
{
private readonly string _value;

private Metro(string value)
{
_value = value ?? throw new ArgumentNullException(nameof(value));
}

public static Metro Amsterdam { get; } = new Metro("AM");
public static Metro Ashburn { get; } = new Metro("DC");
public static Metro Atlanta { get; } = new Metro("AT");
public static Metro Barcelona { get; } = new Metro("BA");
public static Metro Bogota { get; } = new Metro("BG");
public static Metro Bordeaux { get; } = new Metro("BX");
public static Metro Boston { get; } = new Metro("BO");
public static Metro Brussels { get; } = new Metro("BL");
public static Metro Calgary { get; } = new Metro("CL");
public static Metro Canberra { get; } = new Metro("CA");
public static Metro Chicago { get; } = new Metro("CH");
public static Metro Dallas { get; } = new Metro("DA");
public static Metro Denver { get; } = new Metro("DE");
public static Metro Dubai { get; } = new Metro("DX");
public static Metro Dublin { get; } = new Metro("DB");
public static Metro Frankfurt { get; } = new Metro("FR");
public static Metro Geneva { get; } = new Metro("GV");
public static Metro Hamburg { get; } = new Metro("HH");
public static Metro Helsinki { get; } = new Metro("HE");
public static Metro HongKong { get; } = new Metro("HK");
public static Metro Istanbul { get; } = new Metro("IL");
public static Metro Kamloops { get; } = new Metro("KA");
public static Metro Lisbon { get; } = new Metro("LS");
public static Metro London { get; } = new Metro("LD");
public static Metro LosAngeles { get; } = new Metro("LA");
public static Metro Madrid { get; } = new Metro("MD");
public static Metro Manchester { get; } = new Metro("MA");
public static Metro Melbourne { get; } = new Metro("ME");
public static Metro MexicoCity { get; } = new Metro("MX");
public static Metro Miami { get; } = new Metro("MI");
public static Metro Milan { get; } = new Metro("ML");
public static Metro Montreal { get; } = new Metro("MT");
public static Metro Mumbai { get; } = new Metro("MB");
public static Metro Munich { get; } = new Metro("MU");
public static Metro NewYork { get; } = new Metro("NY");
public static Metro Osaka { get; } = new Metro("OS");
public static Metro Paris { get; } = new Metro("PA");
public static Metro Perth { get; } = new Metro("PE");
public static Metro Philadelphia { get; } = new Metro("PH");
public static Metro RioDeJaneiro { get; } = new Metro("RJ");
public static Metro SaoPaulo { get; } = new Metro("SP");
public static Metro Seattle { get; } = new Metro("SE");
public static Metro Seoul { get; } = new Metro("SL");
public static Metro SiliconValley { get; } = new Metro("SV");
public static Metro Singapore { get; } = new Metro("SG");
public static Metro Sofia { get; } = new Metro("SO");
public static Metro Stockholm { get; } = new Metro("SK");
public static Metro Sydney { get; } = new Metro("SY");
public static Metro Tokyo { get; } = new Metro("TY");
public static Metro Toronto { get; } = new Metro("TR");
public static Metro Vancouver { get; } = new Metro("VA");
public static Metro Warsaw { get; } = new Metro("WA");
public static Metro Winnipeg { get; } = new Metro("WI");
public static Metro Zurich { get; } = new Metro("ZH");

public static bool operator ==(Metro left, Metro right) => left.Equals(right);
public static bool operator !=(Metro left, Metro right) => !left.Equals(right);

public static explicit operator string(Metro value) => value._value;

[EditorBrowsable(EditorBrowsableState.Never)]
public override bool Equals(object? obj) => obj is Metro other && Equals(other);
public bool Equals(Metro other) => string.Equals(_value, other._value, StringComparison.Ordinal);

[EditorBrowsable(EditorBrowsableState.Never)]
public override int GetHashCode() => _value?.GetHashCode() ?? 0;

public override string ToString() => _value;
}
}
Loading

0 comments on commit e09b2e3

Please sign in to comment.