1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
// Copyright 2022 Rigetti Computing
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* Rigetti QCS API
*
* # 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://github.com/rigetti/rpcq). Until that changes, we suggest using [pyquil](https://github.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.
*
* The version of the OpenAPI document: 2020-07-31
* Contact: support@rigetti.com
* Generated by: https://openapi-generator.tech
*/
/// BillingProduct : A QCS service product. This may represent one time (such as reservations) or metered services.
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct BillingProduct {
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// Unique identifier for the object.
#[serde(rename = "id")]
pub id: String,
/// This name will show up on associated invoice line item descriptions.
#[serde(rename = "name")]
pub name: String,
/// String representing the object's type. Objects of the same type share the same value.
#[serde(rename = "object")]
pub object: Object,
/// A label that represents units of this product. When set, this will be included in associated invoice line item descriptions.
#[serde(rename = "unitLabel", skip_serializing_if = "Option::is_none")]
pub unit_label: Option<String>,
}
impl BillingProduct {
/// A QCS service product. This may represent one time (such as reservations) or metered services.
pub fn new(id: String, name: String, object: Object) -> BillingProduct {
BillingProduct {
description: None,
id,
name,
object,
unit_label: None,
}
}
}
/// String representing the object's type. Objects of the same type share the same value.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Object {
#[serde(rename = "product")]
Product,
}
impl Default for Object {
fn default() -> Object {
Self::Product
}
}