-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3155 from hashicorp/data/regeneration-from-ba1749…
…574aad5a0566d1a6bca3170ca78e127dc5-rest-api-specs Data: Rest Api Specs - regenerating based on ba17495
- Loading branch information
Showing
9 changed files
with
425 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
data/Pandora.Definitions.ResourceManager/DevCenter/Terraform/DevCenter-Resource-Mappings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Collections.Generic; | ||
using Pandora.Definitions.Interfaces; | ||
using Pandora.Definitions.Mappings; | ||
using Pandora.Definitions.ResourceManager.DevCenter.v2023_04_01.DevCenters; | ||
|
||
namespace Pandora.Definitions.ResourceManager.DevCenter.Terraform; | ||
|
||
public class DevCenterResourceMappings : TerraformMappingDefinition | ||
{ | ||
public List<MappingType> Mappings => new List<MappingType> | ||
{ | ||
Mapping.FromSchema<DevCenterResourceSchema>(s => s.Name).ToResourceIdSegmentNamed("devCenterName"), | ||
Mapping.FromSchema<DevCenterResourceSchema>(s => s.ResourceGroupName).ToResourceIdSegmentNamed("resourceGroupName"), | ||
|
||
Mapping.FromSchema<DevCenterResourceSchema>(s => s.DevCenterUri).ToSdkField<DevCenterPropertiesModel>(m => m.DevCenterUri).Direct(), | ||
Mapping.FromSchema<DevCenterResourceSchema>(s => s.Identity).ToSdkField<DevCenterModel>(m => m.Identity).Direct(), | ||
Mapping.FromSchema<DevCenterResourceSchema>(s => s.Location).ToSdkField<DevCenterModel>(m => m.Location).Direct(), | ||
Mapping.FromSchema<DevCenterResourceSchema>(s => s.Tags).ToSdkField<DevCenterModel>(m => m.Tags).Direct(), | ||
Mapping.FromSchemaModel<DevCenterResourceSchema>().ToSdkField<DevCenterModel>(m => m.Properties).ModelToModel(), | ||
}; | ||
} |
49 changes: 49 additions & 0 deletions
49
data/Pandora.Definitions.ResourceManager/DevCenter/Terraform/DevCenter-Resource-Schema.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System.Collections.Generic; | ||
using Pandora.Definitions.Attributes; | ||
using Pandora.Definitions.Attributes.Validation; | ||
using Pandora.Definitions.CommonSchema; | ||
|
||
namespace Pandora.Definitions.ResourceManager.DevCenter.Terraform; | ||
|
||
public class DevCenterResourceSchema | ||
{ | ||
|
||
[Computed] | ||
[Documentation("The URI of the Dev Center.")] | ||
[HclName("dev_center_uri")] | ||
public string DevCenterUri { get; set; } | ||
|
||
|
||
[Documentation("Specifies the Managed Identity which should be assigned to this Dev Center.")] | ||
[HclName("identity")] | ||
[Optional] | ||
public CommonSchema.SystemAndUserAssignedIdentity Identity { get; set; } | ||
|
||
|
||
[Documentation("The Azure Region where the Dev Center should exist.")] | ||
[ForceNew] | ||
[HclName("location")] | ||
[Required] | ||
public CommonSchema.Location Location { get; set; } | ||
|
||
|
||
[Documentation("Specifies the name of this Dev Center.")] | ||
[ForceNew] | ||
[HclName("name")] | ||
[Required] | ||
public string Name { get; set; } | ||
|
||
|
||
[Documentation("Specifies the name of the Resource Group within which this Dev Center should exist.")] | ||
[ForceNew] | ||
[HclName("resource_group_name")] | ||
[Required] | ||
public CommonSchema.ResourceGroupName ResourceGroupName { get; set; } | ||
|
||
|
||
[Documentation("A mapping of tags which should be assigned to the Dev Center.")] | ||
[HclName("tags")] | ||
[Optional] | ||
public CommonSchema.Tags Tags { get; set; } | ||
|
||
} |
67 changes: 67 additions & 0 deletions
67
data/Pandora.Definitions.ResourceManager/DevCenter/Terraform/DevCenter-Resource-Tests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using System.Collections.Generic; | ||
using Pandora.Definitions.Helpers; | ||
using Pandora.Definitions.Interfaces; | ||
|
||
namespace Pandora.Definitions.ResourceManager.DevCenter.Terraform; | ||
|
||
public class DevCenterResourceTests : TerraformResourceTestDefinition | ||
{ | ||
public string BasicTestConfig => @" | ||
provider 'azurerm' { | ||
features {} | ||
} | ||
resource 'azurerm_dev_center' 'test' { | ||
location = azurerm_resource_group.test.location | ||
name = 'acctestdc-${var.random_string}' | ||
resource_group_name = azurerm_resource_group.test.name | ||
} | ||
".AsTerraformTestConfig(); | ||
|
||
public string RequiresImportConfig => @" | ||
resource 'azurerm_dev_center' 'import' { | ||
location = azurerm_dev_center.test.location | ||
name = azurerm_dev_center.test.name | ||
resource_group_name = azurerm_dev_center.test.resource_group_name | ||
} | ||
".AsTerraformTestConfig(); | ||
|
||
public string? CompleteConfig => @" | ||
provider 'azurerm' { | ||
features {} | ||
} | ||
resource 'azurerm_dev_center' 'test' { | ||
location = azurerm_resource_group.test.location | ||
name = 'acctestdc-${var.random_string}' | ||
resource_group_name = azurerm_resource_group.test.name | ||
tags = { | ||
environment = 'terraform-acctests' | ||
some_key = 'some-value' | ||
} | ||
identity { | ||
type = 'SystemAssigned, UserAssigned' | ||
identity_ids = [azurerm_user_assigned_identity.test.id] | ||
} | ||
} | ||
".AsTerraformTestConfig(); | ||
public string? TemplateConfig => @" | ||
variable 'primary_location' {} | ||
variable 'random_integer' {} | ||
variable 'random_string' {} | ||
resource 'azurerm_resource_group' 'test' { | ||
name = 'acctestrg-${var.random_integer}' | ||
location = var.primary_location | ||
} | ||
resource 'azurerm_user_assigned_identity' 'test' { | ||
name = 'acctest-${var.random_integer}' | ||
resource_group_name = azurerm_resource_group.test.name | ||
location = azurerm_resource_group.test.location | ||
} | ||
".AsTerraformTestConfig(); | ||
|
||
public Dictionary<string, List<string>> OtherTests => new Dictionary<string, List<string>>(); | ||
} |
60 changes: 60 additions & 0 deletions
60
data/Pandora.Definitions.ResourceManager/DevCenter/Terraform/DevCenter-Resource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using System; | ||
using Pandora.Definitions.Helpers; | ||
using Pandora.Definitions.Interfaces; | ||
|
||
namespace Pandora.Definitions.ResourceManager.DevCenter.Terraform; | ||
|
||
public class DevCenterResource : TerraformResourceDefinition | ||
{ | ||
public string DisplayName => "Dev Center"; | ||
public ResourceID ResourceId => new v2023_04_01.DevCenters.DevCenterId(); | ||
public string ResourceLabel => "dev_center"; | ||
public string ResourceCategory => "Dev Center"; | ||
public string ResourceDescription => @"Manages a Dev Center"; | ||
public string ResourceExampleUsage => @"resource 'azurerm_resource_group' 'example' { | ||
name = 'example-resources' | ||
location = 'West Europe' | ||
} | ||
resource 'azurerm_user_assigned_identity' 'example' { | ||
name = 'example' | ||
resource_group_name = azurerm_resource_group.example.name | ||
location = azurerm_resource_group.example.location | ||
} | ||
resource 'azurerm_dev_center' 'example' { | ||
location = azurerm_resource_group.example.location | ||
name = 'example' | ||
resource_group_name = azurerm_resource_group.example.name | ||
}".AsTerraformTestConfig(); | ||
public Type? SchemaModel => typeof(DevCenterResourceSchema); | ||
public TerraformMappingDefinition SchemaMappings => new DevCenterResourceMappings(); | ||
public TerraformResourceTestDefinition Tests => new DevCenterResourceTests(); | ||
|
||
public bool GenerateIDValidationFunction => true; | ||
public bool GenerateModel => true; | ||
public bool GenerateSchema => true; | ||
|
||
public MethodDefinition CreateMethod => new MethodDefinition | ||
{ | ||
Generate = true, | ||
Method = typeof(v2023_04_01.DevCenters.CreateOrUpdateOperation), | ||
TimeoutInMinutes = 30, | ||
}; | ||
public MethodDefinition DeleteMethod => new MethodDefinition | ||
{ | ||
Generate = true, | ||
Method = typeof(v2023_04_01.DevCenters.DeleteOperation), | ||
TimeoutInMinutes = 30, | ||
}; | ||
public MethodDefinition ReadMethod => new MethodDefinition | ||
{ | ||
Generate = true, | ||
Method = typeof(v2023_04_01.DevCenters.GetOperation), | ||
TimeoutInMinutes = 5, | ||
}; | ||
public MethodDefinition? UpdateMethod => new MethodDefinition | ||
{ | ||
Generate = true, | ||
Method = typeof(v2023_04_01.DevCenters.CreateOrUpdateOperation), | ||
TimeoutInMinutes = 30, | ||
}; | ||
} |
26 changes: 26 additions & 0 deletions
26
...ora.Definitions.ResourceManager/DevCenter/Terraform/DevCenterProject-Resource-Mappings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Collections.Generic; | ||
using Pandora.Definitions.Interfaces; | ||
using Pandora.Definitions.Mappings; | ||
using Pandora.Definitions.ResourceManager.DevCenter.v2023_04_01.Projects; | ||
|
||
namespace Pandora.Definitions.ResourceManager.DevCenter.Terraform; | ||
|
||
public class DevCenterProjectResourceMappings : TerraformMappingDefinition | ||
{ | ||
public List<MappingType> Mappings => new List<MappingType> | ||
{ | ||
Mapping.FromSchema<DevCenterProjectResourceSchema>(s => s.Name).ToResourceIdSegmentNamed("projectName"), | ||
Mapping.FromSchema<DevCenterProjectResourceSchema>(s => s.ResourceGroupName).ToResourceIdSegmentNamed("resourceGroupName"), | ||
|
||
Mapping.FromSchema<DevCenterProjectResourceSchema>(s => s.Description).ToSdkField<ProjectPropertiesModel>(m => m.Description).Direct(), | ||
Mapping.FromSchema<DevCenterProjectResourceSchema>(s => s.DevCenterId).ToSdkField<ProjectPropertiesModel>(m => m.DevCenterId).Direct(), | ||
Mapping.FromSchema<DevCenterProjectResourceSchema>(s => s.DevCenterUri).ToSdkField<ProjectPropertiesModel>(m => m.DevCenterUri).Direct(), | ||
Mapping.FromSchema<DevCenterProjectResourceSchema>(s => s.Location).ToSdkField<ProjectModel>(m => m.Location).Direct(), | ||
Mapping.FromSchema<DevCenterProjectResourceSchema>(s => s.MaxDevBoxesPerUser).ToSdkField<ProjectPropertiesModel>(m => m.MaxDevBoxesPerUser).Direct(), | ||
Mapping.FromSchema<DevCenterProjectResourceSchema>(s => s.MaxDevBoxesPerUser).ToSdkField<ProjectUpdatePropertiesModel>(m => m.MaxDevBoxesPerUser).Direct(), | ||
Mapping.FromSchema<DevCenterProjectResourceSchema>(s => s.Tags).ToSdkField<ProjectModel>(m => m.Tags).Direct(), | ||
Mapping.FromSchema<DevCenterProjectResourceSchema>(s => s.Tags).ToSdkField<ProjectUpdateModel>(m => m.Tags).Direct(), | ||
Mapping.FromSchemaModel<DevCenterProjectResourceSchema>().ToSdkField<ProjectModel>(m => m.Properties).ModelToModel(), | ||
Mapping.FromSchemaModel<DevCenterProjectResourceSchema>().ToSdkField<ProjectUpdateModel>(m => m.Properties).ModelToModel(), | ||
}; | ||
} |
63 changes: 63 additions & 0 deletions
63
...ndora.Definitions.ResourceManager/DevCenter/Terraform/DevCenterProject-Resource-Schema.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System.Collections.Generic; | ||
using Pandora.Definitions.Attributes; | ||
using Pandora.Definitions.Attributes.Validation; | ||
using Pandora.Definitions.CommonSchema; | ||
|
||
namespace Pandora.Definitions.ResourceManager.DevCenter.Terraform; | ||
|
||
public class DevCenterProjectResourceSchema | ||
{ | ||
|
||
[Documentation("Description of the project.")] | ||
[ForceNew] | ||
[HclName("description")] | ||
[Optional] | ||
public string Description { get; set; } | ||
|
||
|
||
[Documentation("Resource Id of an associated DevCenter.")] | ||
[ForceNew] | ||
[HclName("dev_center_id")] | ||
[Required] | ||
public string DevCenterId { get; set; } | ||
|
||
|
||
[Computed] | ||
[Documentation("The URI of the Dev Center resource this project is associated with.")] | ||
[HclName("dev_center_uri")] | ||
public string DevCenterUri { get; set; } | ||
|
||
|
||
[Documentation("The Azure Region where the Dev Center Project should exist.")] | ||
[ForceNew] | ||
[HclName("location")] | ||
[Required] | ||
public CommonSchema.Location Location { get; set; } | ||
|
||
|
||
[Documentation("When specified, limits the maximum number of Dev Boxes a single user can create across all pools in the project.")] | ||
[HclName("max_dev_boxes_per_user")] | ||
[Optional] | ||
public int MaxDevBoxesPerUser { get; set; } | ||
|
||
|
||
[Documentation("Specifies the name of this Dev Center Project.")] | ||
[ForceNew] | ||
[HclName("name")] | ||
[Required] | ||
public string Name { get; set; } | ||
|
||
|
||
[Documentation("Specifies the name of the Resource Group within which this Dev Center Project should exist.")] | ||
[ForceNew] | ||
[HclName("resource_group_name")] | ||
[Required] | ||
public CommonSchema.ResourceGroupName ResourceGroupName { get; set; } | ||
|
||
|
||
[Documentation("A mapping of tags which should be assigned to the Dev Center Project.")] | ||
[HclName("tags")] | ||
[Optional] | ||
public CommonSchema.Tags Tags { get; set; } | ||
|
||
} |
72 changes: 72 additions & 0 deletions
72
...andora.Definitions.ResourceManager/DevCenter/Terraform/DevCenterProject-Resource-Tests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using System.Collections.Generic; | ||
using Pandora.Definitions.Helpers; | ||
using Pandora.Definitions.Interfaces; | ||
|
||
namespace Pandora.Definitions.ResourceManager.DevCenter.Terraform; | ||
|
||
public class DevCenterProjectResourceTests : TerraformResourceTestDefinition | ||
{ | ||
public string BasicTestConfig => @" | ||
provider 'azurerm' { | ||
features {} | ||
} | ||
resource 'azurerm_dev_center_project' 'test' { | ||
dev_center_id = azurerm_dev_center.test.id | ||
location = azurerm_resource_group.test.location | ||
name = 'acctestdcp-${var.random_string}' | ||
resource_group_name = azurerm_resource_group.test.name | ||
} | ||
".AsTerraformTestConfig(); | ||
|
||
public string RequiresImportConfig => @" | ||
resource 'azurerm_dev_center_project' 'import' { | ||
dev_center_id = azurerm_dev_center_project.test.dev_center_id | ||
location = azurerm_dev_center_project.test.location | ||
name = azurerm_dev_center_project.test.name | ||
resource_group_name = azurerm_dev_center_project.test.resource_group_name | ||
} | ||
".AsTerraformTestConfig(); | ||
|
||
public string? CompleteConfig => @" | ||
provider 'azurerm' { | ||
features {} | ||
} | ||
resource 'azurerm_dev_center_project' 'test' { | ||
dev_center_id = azurerm_dev_center.test.id | ||
location = azurerm_resource_group.test.location | ||
name = 'acctestdcp-${var.random_string}' | ||
resource_group_name = azurerm_resource_group.test.name | ||
description = 'Description for the Dev Center Project' | ||
max_dev_boxes_per_user = 21 | ||
tags = { | ||
environment = 'terraform-acctests' | ||
some_key = 'some-value' | ||
} | ||
} | ||
".AsTerraformTestConfig(); | ||
public string? TemplateConfig => @" | ||
variable 'primary_location' {} | ||
variable 'random_integer' {} | ||
variable 'random_string' {} | ||
resource 'azurerm_dev_center' 'test' { | ||
name = 'acctestdc-${var.random_string}' | ||
resource_group_name = azurerm_resource_group.test.name | ||
location = azurerm_resource_group.test.location | ||
identity { | ||
type = 'SystemAssigned' | ||
} | ||
} | ||
resource 'azurerm_resource_group' 'test' { | ||
name = 'acctestrg-${var.random_integer}' | ||
location = var.primary_location | ||
} | ||
".AsTerraformTestConfig(); | ||
|
||
public Dictionary<string, List<string>> OtherTests => new Dictionary<string, List<string>>(); | ||
} |
Oops, something went wrong.