1. Packages
  2. OVH
  3. API Docs
  4. Order
  5. getCartProduct
OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud

ovh.Order.getCartProduct

Explore with Pulumi AI

ovh logo
OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud

    Use this data source to retrieve information of order cart product 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,
    }));
    const plans = mycart.then(mycart => ovh.Order.getCartProduct({
        cartId: mycart.id,
        product: "...",
    }));
    
    import pulumi
    import pulumi_ovh as ovh
    
    myaccount = ovh.Me.get_me()
    mycart = ovh.Order.get_cart(ovh_subsidiary=myaccount.ovh_subsidiary)
    plans = ovh.Order.get_cart_product(cart_id=mycart.id,
        product="...")
    
    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, map[string]interface{}{}, nil)
    		if err != nil {
    			return err
    		}
    		mycart, err := Order.GetCart(ctx, &order.GetCartArgs{
    			OvhSubsidiary: myaccount.OvhSubsidiary,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = Order.GetCartProduct(ctx, &order.GetCartProductArgs{
    			CartId:  mycart.Id,
    			Product: "...",
    		}, 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),
        });
    
        var plans = Ovh.Order.GetCartProduct.Invoke(new()
        {
            CartId = mycart.Apply(getCartResult => getCartResult.Id),
            Product = "...",
        });
    
    });
    
    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 com.pulumi.ovh.Order.inputs.GetCartProductArgs;
    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());
    
            final var plans = OrderFunctions.getCartProduct(GetCartProductArgs.builder()
                .cartId(mycart.applyValue(getCartResult -> getCartResult.id()))
                .product("...")
                .build());
    
        }
    }
    
    variables:
      myaccount:
        fn::invoke:
          Function: ovh:Me:getMe
          Arguments: {}
      mycart:
        fn::invoke:
          Function: ovh:Order:getCart
          Arguments:
            ovhSubsidiary: ${myaccount.ovhSubsidiary}
      plans:
        fn::invoke:
          Function: ovh:Order:getCartProduct
          Arguments:
            cartId: ${mycart.id}
            product: '...'
    

    Using getCartProduct

    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 getCartProduct(args: GetCartProductArgs, opts?: InvokeOptions): Promise<GetCartProductResult>
    function getCartProductOutput(args: GetCartProductOutputArgs, opts?: InvokeOptions): Output<GetCartProductResult>
    def get_cart_product(cart_id: Optional[str] = None,
                         product: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetCartProductResult
    def get_cart_product_output(cart_id: Optional[pulumi.Input[str]] = None,
                         product: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetCartProductResult]
    func GetCartProduct(ctx *Context, args *GetCartProductArgs, opts ...InvokeOption) (*GetCartProductResult, error)
    func GetCartProductOutput(ctx *Context, args *GetCartProductOutputArgs, opts ...InvokeOption) GetCartProductResultOutput

    > Note: This function is named GetCartProduct in the Go SDK.

    public static class GetCartProduct 
    {
        public static Task<GetCartProductResult> InvokeAsync(GetCartProductArgs args, InvokeOptions? opts = null)
        public static Output<GetCartProductResult> Invoke(GetCartProductInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCartProductResult> getCartProduct(GetCartProductArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: ovh:Order/getCartProduct:getCartProduct
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CartId string
    Cart identifier
    Product string
    product
    CartId string
    Cart identifier
    Product string
    product
    cartId String
    Cart identifier
    product String
    product
    cartId string
    Cart identifier
    product string
    product
    cart_id str
    Cart identifier
    product str
    product
    cartId String
    Cart identifier
    product String
    product

    getCartProduct Result

    The following output properties are available:

    CartId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Product string
    Results List<GetCartProductResult>
    products results
    CartId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Product string
    Results []GetCartProductResult
    products results
    cartId String
    id String
    The provider-assigned unique ID for this managed resource.
    product String
    results List<GetCartProductResult>
    products results
    cartId string
    id string
    The provider-assigned unique ID for this managed resource.
    product string
    results GetCartProductResult[]
    products results
    cart_id str
    id str
    The provider-assigned unique ID for this managed resource.
    product str
    results Sequence[order.GetCartProductResult]
    products results
    cartId String
    id String
    The provider-assigned unique ID for this managed resource.
    product String
    results List<Property Map>
    products results

    Supporting Types

    GetCartProductResult

    PlanCode string
    Product offer identifier
    Prices List<GetCartProductResultPrice>
    Prices of the product offer
    ProductName string
    Name of the product
    ProductType string
    Product type
    PlanCode string
    Product offer identifier
    Prices []GetCartProductResultPrice
    Prices of the product offer
    ProductName string
    Name of the product
    ProductType string
    Product type
    planCode String
    Product offer identifier
    prices List<GetCartProductResultPrice>
    Prices of the product offer
    productName String
    Name of the product
    productType String
    Product type
    planCode string
    Product offer identifier
    prices GetCartProductResultPrice[]
    Prices of the product offer
    productName string
    Name of the product
    productType string
    Product type
    plan_code str
    Product offer identifier
    prices Sequence[order.GetCartProductResultPrice]
    Prices of the product offer
    product_name str
    Name of the product
    product_type str
    Product type
    planCode String
    Product offer identifier
    prices List<Property Map>
    Prices of the product offer
    productName String
    Name of the product
    productType String
    Product type

    GetCartProductResultPrice

    Capacities List<object>
    Capacities of the pricing (type of pricing)
    Description string
    Description of the pricing
    Duration string
    Duration for ordering the product
    Interval int
    Interval of renewal
    MaximumQuantity int
    Maximum quantity that can be ordered
    MaximumRepeat int
    Maximum repeat for renewal
    MinimumQuantity int
    Minimum quantity that can be ordered
    MinimumRepeat int
    Minimum repeat for renewal
    PriceInUcents int
    Price of the product in micro-centims
    Prices List<GetCartProductResultPricePrice>
    Price of the product (Price with its currency and textual representation)
    PricingMode string
    Pricing model identifier
    PricingType string
    Pricing type
    Capacities []interface{}
    Capacities of the pricing (type of pricing)
    Description string
    Description of the pricing
    Duration string
    Duration for ordering the product
    Interval int
    Interval of renewal
    MaximumQuantity int
    Maximum quantity that can be ordered
    MaximumRepeat int
    Maximum repeat for renewal
    MinimumQuantity int
    Minimum quantity that can be ordered
    MinimumRepeat int
    Minimum repeat for renewal
    PriceInUcents int
    Price of the product in micro-centims
    Prices []GetCartProductResultPricePrice
    Price of the product (Price with its currency and textual representation)
    PricingMode string
    Pricing model identifier
    PricingType string
    Pricing type
    capacities List<Object>
    Capacities of the pricing (type of pricing)
    description String
    Description of the pricing
    duration String
    Duration for ordering the product
    interval Integer
    Interval of renewal
    maximumQuantity Integer
    Maximum quantity that can be ordered
    maximumRepeat Integer
    Maximum repeat for renewal
    minimumQuantity Integer
    Minimum quantity that can be ordered
    minimumRepeat Integer
    Minimum repeat for renewal
    priceInUcents Integer
    Price of the product in micro-centims
    prices List<GetCartProductResultPricePrice>
    Price of the product (Price with its currency and textual representation)
    pricingMode String
    Pricing model identifier
    pricingType String
    Pricing type
    capacities any[]
    Capacities of the pricing (type of pricing)
    description string
    Description of the pricing
    duration string
    Duration for ordering the product
    interval number
    Interval of renewal
    maximumQuantity number
    Maximum quantity that can be ordered
    maximumRepeat number
    Maximum repeat for renewal
    minimumQuantity number
    Minimum quantity that can be ordered
    minimumRepeat number
    Minimum repeat for renewal
    priceInUcents number
    Price of the product in micro-centims
    prices GetCartProductResultPricePrice[]
    Price of the product (Price with its currency and textual representation)
    pricingMode string
    Pricing model identifier
    pricingType string
    Pricing type
    capacities Sequence[Any]
    Capacities of the pricing (type of pricing)
    description str
    Description of the pricing
    duration str
    Duration for ordering the product
    interval int
    Interval of renewal
    maximum_quantity int
    Maximum quantity that can be ordered
    maximum_repeat int
    Maximum repeat for renewal
    minimum_quantity int
    Minimum quantity that can be ordered
    minimum_repeat int
    Minimum repeat for renewal
    price_in_ucents int
    Price of the product in micro-centims
    prices Sequence[order.GetCartProductResultPricePrice]
    Price of the product (Price with its currency and textual representation)
    pricing_mode str
    Pricing model identifier
    pricing_type str
    Pricing type
    capacities List<Any>
    Capacities of the pricing (type of pricing)
    description String
    Description of the pricing
    duration String
    Duration for ordering the product
    interval Number
    Interval of renewal
    maximumQuantity Number
    Maximum quantity that can be ordered
    maximumRepeat Number
    Maximum repeat for renewal
    minimumQuantity Number
    Minimum quantity that can be ordered
    minimumRepeat Number
    Minimum repeat for renewal
    priceInUcents Number
    Price of the product in micro-centims
    prices List<Property Map>
    Price of the product (Price with its currency and textual representation)
    pricingMode String
    Pricing model identifier
    pricingType String
    Pricing type

    GetCartProductResultPricePrice

    CurrencyCode string
    Currency code
    Text string
    Textual representation
    Value double
    The effective price
    CurrencyCode string
    Currency code
    Text string
    Textual representation
    Value float64
    The effective price
    currencyCode String
    Currency code
    text String
    Textual representation
    value Double
    The effective price
    currencyCode string
    Currency code
    text string
    Textual representation
    value number
    The effective price
    currency_code str
    Currency code
    text str
    Textual representation
    value float
    The effective price
    currencyCode String
    Currency code
    text String
    Textual representation
    value Number
    The effective price

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud