OVHCloud v0.45.0 published on Tuesday, Jun 4, 2024 by OVHcloud
ovh.Order.getCart
Explore with Pulumi AI
Use this data source to create a temporary order cart to retrieve information order cart products.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@pulumi/ovh";
const myaccount = ovh.Me.getMe({});
const mycart = myaccount.then(myaccount => ovh.Order.getCart({
    ovhSubsidiary: myaccount.ovhSubsidiary,
}));
import pulumi
import pulumi_ovh as ovh
myaccount = ovh.Me.get_me()
mycart = ovh.Order.get_cart(ovh_subsidiary=myaccount.ovh_subsidiary)
package main
import (
	"github.com/ovh/pulumi-ovh/sdk/go/ovh/Me"
	"github.com/ovh/pulumi-ovh/sdk/go/ovh/Order"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		myaccount, err := Me.GetMe(ctx, nil, nil)
		if err != nil {
			return err
		}
		_, err = Order.GetCart(ctx, &order.GetCartArgs{
			OvhSubsidiary: myaccount.OvhSubsidiary,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
return await Deployment.RunAsync(() => 
{
    var myaccount = Ovh.Me.GetMe.Invoke();
    var mycart = Ovh.Order.GetCart.Invoke(new()
    {
        OvhSubsidiary = myaccount.Apply(getMeResult => getMeResult.OvhSubsidiary),
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.Me.MeFunctions;
import com.pulumi.ovh.Order.OrderFunctions;
import com.pulumi.ovh.Order.inputs.GetCartArgs;
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) {
        final var myaccount = MeFunctions.getMe();
        final var mycart = OrderFunctions.getCart(GetCartArgs.builder()
            .ovhSubsidiary(myaccount.applyValue(getMeResult -> getMeResult.ovhSubsidiary()))
            .build());
    }
}
variables:
  myaccount:
    fn::invoke:
      Function: ovh:Me:getMe
      Arguments: {}
  mycart:
    fn::invoke:
      Function: ovh:Order:getCart
      Arguments:
        ovhSubsidiary: ${myaccount.ovhSubsidiary}
Using getCart
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getCart(args: GetCartArgs, opts?: InvokeOptions): Promise<GetCartResult>
function getCartOutput(args: GetCartOutputArgs, opts?: InvokeOptions): Output<GetCartResult>def get_cart(assign: Optional[bool] = None,
             description: Optional[str] = None,
             expire: Optional[str] = None,
             ovh_subsidiary: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GetCartResult
def get_cart_output(assign: Optional[pulumi.Input[bool]] = None,
             description: Optional[pulumi.Input[str]] = None,
             expire: Optional[pulumi.Input[str]] = None,
             ovh_subsidiary: Optional[pulumi.Input[str]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetCartResult]func GetCart(ctx *Context, args *GetCartArgs, opts ...InvokeOption) (*GetCartResult, error)
func GetCartOutput(ctx *Context, args *GetCartOutputArgs, opts ...InvokeOption) GetCartResultOutput> Note: This function is named GetCart in the Go SDK.
public static class GetCart 
{
    public static Task<GetCartResult> InvokeAsync(GetCartArgs args, InvokeOptions? opts = null)
    public static Output<GetCartResult> Invoke(GetCartInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetCartResult> getCart(GetCartArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: ovh:Order/getCart:getCart
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Ovh
Subsidiary string - OVHcloud Subsidiary. Country of OVHcloud legal entity you'll be billed by. List of supported subsidiaries available on API at /1.0/me.json under 
models.nichandle.OvhSubsidiaryEnum - Assign bool
 - Assign a shopping cart to a logged in client. Values can be 
trueorfalse. - Description string
 - Description of your cart
 - Expire string
 - Expiration time (format: 2006-01-02T15:04:05+00:00)
 
- Ovh
Subsidiary string - OVHcloud Subsidiary. Country of OVHcloud legal entity you'll be billed by. List of supported subsidiaries available on API at /1.0/me.json under 
models.nichandle.OvhSubsidiaryEnum - Assign bool
 - Assign a shopping cart to a logged in client. Values can be 
trueorfalse. - Description string
 - Description of your cart
 - Expire string
 - Expiration time (format: 2006-01-02T15:04:05+00:00)
 
- ovh
Subsidiary String - OVHcloud Subsidiary. Country of OVHcloud legal entity you'll be billed by. List of supported subsidiaries available on API at /1.0/me.json under 
models.nichandle.OvhSubsidiaryEnum - assign Boolean
 - Assign a shopping cart to a logged in client. Values can be 
trueorfalse. - description String
 - Description of your cart
 - expire String
 - Expiration time (format: 2006-01-02T15:04:05+00:00)
 
- ovh
Subsidiary string - OVHcloud Subsidiary. Country of OVHcloud legal entity you'll be billed by. List of supported subsidiaries available on API at /1.0/me.json under 
models.nichandle.OvhSubsidiaryEnum - assign boolean
 - Assign a shopping cart to a logged in client. Values can be 
trueorfalse. - description string
 - Description of your cart
 - expire string
 - Expiration time (format: 2006-01-02T15:04:05+00:00)
 
- ovh_
subsidiary str - OVHcloud Subsidiary. Country of OVHcloud legal entity you'll be billed by. List of supported subsidiaries available on API at /1.0/me.json under 
models.nichandle.OvhSubsidiaryEnum - assign bool
 - Assign a shopping cart to a logged in client. Values can be 
trueorfalse. - description str
 - Description of your cart
 - expire str
 - Expiration time (format: 2006-01-02T15:04:05+00:00)
 
- ovh
Subsidiary String - OVHcloud Subsidiary. Country of OVHcloud legal entity you'll be billed by. List of supported subsidiaries available on API at /1.0/me.json under 
models.nichandle.OvhSubsidiaryEnum - assign Boolean
 - Assign a shopping cart to a logged in client. Values can be 
trueorfalse. - description String
 - Description of your cart
 - expire String
 - Expiration time (format: 2006-01-02T15:04:05+00:00)
 
getCart Result
The following output properties are available:
- Cart
Id string - Cart identifier
 - Expire string
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Items List<int>
 - Items of your cart
 - Ovh
Subsidiary string - Read
Only bool - Indicates if the cart has already been validated
 - Assign bool
 - Description string
 
- Cart
Id string - Cart identifier
 - Expire string
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Items []int
 - Items of your cart
 - Ovh
Subsidiary string - Read
Only bool - Indicates if the cart has already been validated
 - Assign bool
 - Description string
 
- cart
Id String - Cart identifier
 - expire String
 - id String
 - The provider-assigned unique ID for this managed resource.
 - items List<Integer>
 - Items of your cart
 - ovh
Subsidiary String - read
Only Boolean - Indicates if the cart has already been validated
 - assign Boolean
 - description String
 
- cart
Id string - Cart identifier
 - expire string
 - id string
 - The provider-assigned unique ID for this managed resource.
 - items number[]
 - Items of your cart
 - ovh
Subsidiary string - read
Only boolean - Indicates if the cart has already been validated
 - assign boolean
 - description string
 
- cart_
id str - Cart identifier
 - expire str
 - id str
 - The provider-assigned unique ID for this managed resource.
 - items Sequence[int]
 - Items of your cart
 - ovh_
subsidiary str - read_
only bool - Indicates if the cart has already been validated
 - assign bool
 - description str
 
- cart
Id String - Cart identifier
 - expire String
 - id String
 - The provider-assigned unique ID for this managed resource.
 - items List<Number>
 - Items of your cart
 - ovh
Subsidiary String - read
Only Boolean - Indicates if the cart has already been validated
 - assign Boolean
 - description String
 
Package Details
- Repository
 - ovh ovh/pulumi-ovh
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
ovhTerraform Provider.