qcs_api/models/
billing_product.rs

1/*
2 * Rigetti QCS API
3 *
4 * # Introduction  This is the documentation for the Rigetti QCS HTTP API.  You can find out more about Rigetti at [https://rigetti.com](https://rigetti.com), and also interact with QCS via the web at [https://qcs.rigetti.com](https://qcs.rigetti.com).  This API is documented in **OpenAPI format** and so is compatible with the dozens of language-specific client generators available [here](https://github.com/OpenAPITools/openapi-generator) and elsewhere on the web.  # Principles  This API follows REST design principles where appropriate, and otherwise an HTTP RPC paradigm. We adhere to the Google [API Improvement Proposals](https://google.aip.dev/general) where reasonable to provide a consistent, intuitive developer experience. HTTP response codes match their specifications, and error messages fit a common format.  # Authentication  All access to the QCS API requires OAuth2 authentication provided by Okta. You can request access [here](https://www.rigetti.com/get-quantum). Once you have a user account, you can download your access token from QCS [here](https://qcs.rigetti.com/auth/token).   That access token is valid for 24 hours after issuance. The value of `access_token` within the JSON file is the token used for authentication (don't use the entire JSON file).  Authenticate requests using the `Authorization` header and a `Bearer` prefix:  ``` curl --header \"Authorization: Bearer eyJraW...Iow\" ```  # Quantum Processor Access  Access to the quantum processors themselves is not yet provided directly by this HTTP API, but is instead performed over ZeroMQ/[rpcq](https://gitlab.com/rigetti/rpcq). Until that changes, we suggest using [pyquil](https://gitlab.com/rigetti/pyquil) to build and execute quantum programs via the Legacy API.  # Legacy API  Our legacy HTTP API remains accessible at https://forest-server.qcs.rigetti.com, and it shares a source of truth with this API's services. You can use either service with the same user account and means of authentication. We strongly recommend using the API documented here, as the legacy API is on the path to deprecation.
5 *
6 * The version of the OpenAPI document: 2020-07-31
7 * Contact: support@rigetti.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// BillingProduct : A QCS service product. This may represent one time (such as reservations) or metered services.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BillingProduct {
15    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
16    pub description: Option<String>,
17    /// Unique identifier for the object.
18    #[serde(rename = "id")]
19    pub id: String,
20    /// This name will show up on associated invoice line item descriptions.
21    #[serde(rename = "name")]
22    pub name: String,
23    /// String representing the object's type. Objects of the same type share the same value.
24    #[serde(rename = "object")]
25    pub object: Object,
26    /// A label that represents units of this product. When set, this will be included in associated invoice line item descriptions.
27    #[serde(rename = "unitLabel", skip_serializing_if = "Option::is_none")]
28    pub unit_label: Option<String>,
29}
30
31impl BillingProduct {
32    /// A QCS service product. This may represent one time (such as reservations) or metered services.
33    pub fn new(id: String, name: String, object: Object) -> BillingProduct {
34        BillingProduct {
35            description: None,
36            id,
37            name,
38            object,
39            unit_label: None,
40        }
41    }
42}
43
44/// String representing the object's type. Objects of the same type share the same value.
45#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
46pub enum Object {
47    #[serde(rename = "product")]
48    Product,
49}
50
51impl Default for Object {
52    fn default() -> Object {
53        Self::Product
54    }
55}