Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azure.databoxedge.kotlin.Order.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.databoxedge.kotlin
import com.pulumi.azure.databoxedge.kotlin.outputs.OrderContact
import com.pulumi.azure.databoxedge.kotlin.outputs.OrderReturnTracking
import com.pulumi.azure.databoxedge.kotlin.outputs.OrderShipmentAddress
import com.pulumi.azure.databoxedge.kotlin.outputs.OrderShipmentHistory
import com.pulumi.azure.databoxedge.kotlin.outputs.OrderShipmentTracking
import com.pulumi.azure.databoxedge.kotlin.outputs.OrderStatus
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.azure.databoxedge.kotlin.outputs.OrderContact.Companion.toKotlin as orderContactToKotlin
import com.pulumi.azure.databoxedge.kotlin.outputs.OrderReturnTracking.Companion.toKotlin as orderReturnTrackingToKotlin
import com.pulumi.azure.databoxedge.kotlin.outputs.OrderShipmentAddress.Companion.toKotlin as orderShipmentAddressToKotlin
import com.pulumi.azure.databoxedge.kotlin.outputs.OrderShipmentHistory.Companion.toKotlin as orderShipmentHistoryToKotlin
import com.pulumi.azure.databoxedge.kotlin.outputs.OrderShipmentTracking.Companion.toKotlin as orderShipmentTrackingToKotlin
import com.pulumi.azure.databoxedge.kotlin.outputs.OrderStatus.Companion.toKotlin as orderStatusToKotlin
/**
* Builder for [Order].
*/
@PulumiTagMarker
public class OrderResourceBuilder internal constructor() {
public var name: String? = null
public var args: OrderArgs = OrderArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend OrderArgsBuilder.() -> Unit) {
val builder = OrderArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): Order {
val builtJavaResource = com.pulumi.azure.databoxedge.Order(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Order(builtJavaResource)
}
}
/**
* Manages a Databox Edge Order.
* !> Creation of Databox Edge Order is not supported by the Azure API - as such the `azure.databoxedge.Order` resource is deprecated and will be removed in v4.0 of the AzureRM Provider.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "example-databoxedge",
* location: "West Europe",
* });
* const exampleDevice = new azure.databoxedge.Device("example", {
* name: "example-device",
* resourceGroupName: example.name,
* location: example.location,
* skuName: "EdgeP_Base-Standard",
* });
* const exampleOrder = new azure.databoxedge.Order("example", {
* resourceGroupName: example.name,
* deviceName: exampleDevice.name,
* contact: {
* name: "TerraForm Test",
* emails: ["creator4983@FlynnsArcade.com"],
* companyName: "Flynn's Arcade",
* phoneNumber: "(800) 555-1234",
* },
* shipmentAddress: {
* addresses: ["One Microsoft Way"],
* city: "Redmond",
* postalCode: "98052",
* state: "WA",
* country: "United States",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-databoxedge",
* location="West Europe")
* example_device = azure.databoxedge.Device("example",
* name="example-device",
* resource_group_name=example.name,
* location=example.location,
* sku_name="EdgeP_Base-Standard")
* example_order = azure.databoxedge.Order("example",
* resource_group_name=example.name,
* device_name=example_device.name,
* contact={
* "name": "TerraForm Test",
* "emails": ["creator4983@FlynnsArcade.com"],
* "company_name": "Flynn's Arcade",
* "phone_number": "(800) 555-1234",
* },
* shipment_address={
* "addresses": ["One Microsoft Way"],
* "city": "Redmond",
* "postal_code": "98052",
* "state": "WA",
* "country": "United States",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example-databoxedge",
* Location = "West Europe",
* });
* var exampleDevice = new Azure.DataboxEdge.Device("example", new()
* {
* Name = "example-device",
* ResourceGroupName = example.Name,
* Location = example.Location,
* SkuName = "EdgeP_Base-Standard",
* });
* var exampleOrder = new Azure.DataboxEdge.Order("example", new()
* {
* ResourceGroupName = example.Name,
* DeviceName = exampleDevice.Name,
* Contact = new Azure.DataboxEdge.Inputs.OrderContactArgs
* {
* Name = "TerraForm Test",
* Emails = new[]
* {
* "[email protected] ",
* },
* CompanyName = "Flynn's Arcade",
* PhoneNumber = "(800) 555-1234",
* },
* ShipmentAddress = new Azure.DataboxEdge.Inputs.OrderShipmentAddressArgs
* {
* Addresses = new[]
* {
* "One Microsoft Way",
* },
* City = "Redmond",
* PostalCode = "98052",
* State = "WA",
* Country = "United States",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databoxedge"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("example-databoxedge"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleDevice, err := databoxedge.NewDevice(ctx, "example", &databoxedge.DeviceArgs{
* Name: pulumi.String("example-device"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* SkuName: pulumi.String("EdgeP_Base-Standard"),
* })
* if err != nil {
* return err
* }
* _, err = databoxedge.NewOrder(ctx, "example", &databoxedge.OrderArgs{
* ResourceGroupName: example.Name,
* DeviceName: exampleDevice.Name,
* Contact: &databoxedge.OrderContactArgs{
* Name: pulumi.String("TerraForm Test"),
* Emails: pulumi.StringArray{
* pulumi.String("[email protected] "),
* },
* CompanyName: pulumi.String("Flynn's Arcade"),
* PhoneNumber: pulumi.String("(800) 555-1234"),
* },
* ShipmentAddress: &databoxedge.OrderShipmentAddressArgs{
* Addresses: pulumi.StringArray{
* pulumi.String("One Microsoft Way"),
* },
* City: pulumi.String("Redmond"),
* PostalCode: pulumi.String("98052"),
* State: pulumi.String("WA"),
* Country: pulumi.String("United States"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.databoxedge.Device;
* import com.pulumi.azure.databoxedge.DeviceArgs;
* import com.pulumi.azure.databoxedge.Order;
* import com.pulumi.azure.databoxedge.OrderArgs;
* import com.pulumi.azure.databoxedge.inputs.OrderContactArgs;
* import com.pulumi.azure.databoxedge.inputs.OrderShipmentAddressArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-databoxedge")
* .location("West Europe")
* .build());
* var exampleDevice = new Device("exampleDevice", DeviceArgs.builder()
* .name("example-device")
* .resourceGroupName(example.name())
* .location(example.location())
* .skuName("EdgeP_Base-Standard")
* .build());
* var exampleOrder = new Order("exampleOrder", OrderArgs.builder()
* .resourceGroupName(example.name())
* .deviceName(exampleDevice.name())
* .contact(OrderContactArgs.builder()
* .name("TerraForm Test")
* .emails("[email protected] ")
* .companyName("Flynn's Arcade")
* .phoneNumber("(800) 555-1234")
* .build())
* .shipmentAddress(OrderShipmentAddressArgs.builder()
* .addresses("One Microsoft Way")
* .city("Redmond")
* .postalCode("98052")
* .state("WA")
* .country("United States")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-databoxedge
* location: West Europe
* exampleDevice:
* type: azure:databoxedge:Device
* name: example
* properties:
* name: example-device
* resourceGroupName: ${example.name}
* location: ${example.location}
* skuName: EdgeP_Base-Standard
* exampleOrder:
* type: azure:databoxedge:Order
* name: example
* properties:
* resourceGroupName: ${example.name}
* deviceName: ${exampleDevice.name}
* contact:
* name: TerraForm Test
* emails:
* - [email protected]
* companyName: Flynn's Arcade
* phoneNumber: (800) 555-1234
* shipmentAddress:
* addresses:
* - One Microsoft Way
* city: Redmond
* postalCode: '98052'
* state: WA
* country: United States
* ```
*
* ## Import
* Databox Edge Orders can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:databoxedge/order:Order example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/device1
* ```
*/
public class Order internal constructor(
override val javaResource: com.pulumi.azure.databoxedge.Order,
) : KotlinCustomResource(javaResource, OrderMapper) {
/**
* A `contact` block as defined below.
*/
public val contact: Output
get() = javaResource.contact().applyValue({ args0 ->
args0.let({ args0 ->
orderContactToKotlin(args0)
})
})
/**
* The name of the Databox Edge Device this order is for. Changing this forces a new Databox Edge Order to be created.
*/
public val deviceName: Output
get() = javaResource.deviceName().applyValue({ args0 -> args0 })
/**
* The Name of this Databox Edge Order.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The name of the Resource Group where the Databox Edge Order should exist. Changing this forces a new Databox Edge Order to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* Tracking information for the package returned from the customer whether it has an original or a replacement device. A `return_tracking` block as defined below.
*/
public val returnTrackings: Output>
get() = javaResource.returnTrackings().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> orderReturnTrackingToKotlin(args0) })
})
})
/**
* Serial number of the device being tracked.
*/
public val serialNumber: Output
get() = javaResource.serialNumber().applyValue({ args0 -> args0 })
/**
* A `shipment_address` block as defined below.
*/
public val shipmentAddress: Output
get() = javaResource.shipmentAddress().applyValue({ args0 ->
args0.let({ args0 ->
orderShipmentAddressToKotlin(args0)
})
})
/**
* List of status changes in the order. A `shipment_history` block as defined below.
*/
public val shipmentHistories: Output>
get() = javaResource.shipmentHistories().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> orderShipmentHistoryToKotlin(args0) })
})
})
/**
* Tracking information for the package delivered to the customer whether it has an original or a replacement device. A `shipment_tracking` block as defined below.
*/
public val shipmentTrackings: Output>
get() = javaResource.shipmentTrackings().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> orderShipmentTrackingToKotlin(args0) })
})
})
/**
* The current status of the order. A `status` block as defined below.
*/
public val statuses: Output>
get() = javaResource.statuses().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
orderStatusToKotlin(args0)
})
})
})
}
public object OrderMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.databoxedge.Order::class == javaResource::class
override fun map(javaResource: Resource): Order = Order(
javaResource as
com.pulumi.azure.databoxedge.Order,
)
}
/**
* @see [Order].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Order].
*/
public suspend fun order(name: String, block: suspend OrderResourceBuilder.() -> Unit): Order {
val builder = OrderResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Order].
* @param name The _unique_ name of the resulting resource.
*/
public fun order(name: String): Order {
val builder = OrderResourceBuilder()
builder.name(name)
return builder.build()
}