Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eng 6888 dotnet 3.0.x documentation #409

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reactor Formulas
  • Loading branch information
greathouse committed Jul 1, 2024
commit 1e461cd35ca1118b453849e16e63cf20580a96ba
184 changes: 110 additions & 74 deletions docs/api/reactors/reactor-formulas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,20 @@ const reactorFormula = await bt.reactorFormulas.create({
<TabItem value="csharp" label="C#">

```csharp showLineNumbers
using BasisTheory.net.ReactorFormulas;
using BasisTheory.net.Api;
using BasisTheory.net.Client;
using BasisTheory.net.Model;

var client = new ReactorFormulaClient("<MANAGEMENT_API_KEY>");
Configuration config = new Configuration();
config.BasePath = "https://api.basistheory.com";
config.AddApiKey("BT-API-KEY", "YOUR_API_KEY");

var reactorFormula = await client.CreateAsync(new ReactorFormula {
Name = "My Private Reactor",
Description = "Securely exchange token for another token",
Type = "private",
Icon = "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
Code = @"
var apiInstance = new ReactorFormulasApi(config);
var createReactorFormulaRequest = new CreateReactorFormulaRequest(name: "My Private Reactor", type: "private")
{
Description = "Securely exchange token for another token",
Icon = "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
Code = @"
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY

Expand All @@ -155,27 +159,29 @@ var reactorFormula = await client.CreateAsync(new ReactorFormula {
};
};
",
Configuration = new List<ReactorFormulaConfiguration> {
new ReactorFormulaConfiguration {
Name = "SERVICE_API_KEY",
Description = "Configuration description",
Type = "string"
}
},
RequestParameters = new List<ReactorFormulaRequestParameter> {
new ReactorFormulaRequestParameter {
Name = "request_parameter_1",
Description = "Request parameter description",
Type = "string"
},
new ReactorFormulaRequestParameter {
Name = "request_parameter_2",
Description = "Request parameter description",
Type = "boolean",
IsOptional = true
}
}
});
_Configuration =
[
new("SERVICE_API_KEY", type: "string")
{
Description = "Configuration description"
}
],
RequestParameters =
[
new("request_parameter_1", type: "string")
{
Description = "Request parameter description"
},

new("request_parameter_2", type: "boolean")
{
Description = "Request parameter description",
Optional = true
}
]
};

ReactorFormula result = apiInstance.Create(createReactorFormulaRequest);
```

</TabItem>
Expand Down Expand Up @@ -434,11 +440,21 @@ const reactorFormulas = await bt.reactorFormulas.list();
<TabItem value="csharp" label="C#">

```csharp showLineNumbers
using BasisTheory.net.ReactorFormulas;
using BasisTheory.net.Api;
using BasisTheory.net.Client;
using BasisTheory.net.Model;

var client = new ReactorFormulaClient("<MANAGEMENT_API_KEY>");
Configuration config = new Configuration();
config.BasePath = "https://api.basistheory.com";
config.AddApiKey("BT-API-KEY", "YOUR_API_KEY");

var reactorFormulas = await client.GetAsync();
var apiInstance = new ReactorFormulasApi(config);
var name = "";
var page = 1;
var start = "";
var size = 1;

ReactorFormulaPaginatedList result = apiInstance.Get(name, page, start, size);
```

</TabItem>
Expand Down Expand Up @@ -606,11 +622,18 @@ const reactorFormula = await bt.reactorFormulas.retrieve(
<TabItem value="csharp" label="C#">

```csharp showLineNumbers
using BasisTheory.net.ReactorFormulas;
using BasisTheory.net.Api;
using BasisTheory.net.Client;
using BasisTheory.net.Model;

Configuration config = new Configuration();
config.BasePath = "https://api.basistheory.com";
config.AddApiKey("BT-API-KEY", "YOUR_API_KEY");

var client = new ReactorFormulaClient("<MANAGEMENT_API_KEY>");
var apiInstance = new ReactorFormulasApi(config);
var id = "";

var reactorFormula = await client.GetByIdAsync("17069df1-80f4-439e-86a7-4121863e4678");
ReactorFormula result = apiInstance.GetById(id);
```

</TabItem>
Expand Down Expand Up @@ -842,49 +865,55 @@ const reactorFormula = await bt.reactorFormulas.update('17069df1-80f4-439e-86a7-
<TabItem value="csharp" label="C#">

```csharp showLineNumbers
using BasisTheory.net.ReactorFormulas;
using BasisTheory.net.Api;
using BasisTheory.net.Client;
using BasisTheory.net.Model;

Configuration config = new Configuration();
config.BasePath = "https://api.basistheory.com";
config.AddApiKey("BT-API-KEY", "YOUR_API_KEY");

var client = new ReactorFormulaClient("<MANAGEMENT_API_KEY>");
var id = "";

var reactorFormula = await client.UpdateAsync("17069df1-80f4-439e-86a7-4121863e4678",
new ReactorFormula {
Name = "My Private Reactor",
var apiInstance = new ReactorFormulasApi(config);
var updateReactorFormulaRequest = new UpdateReactorFormulaRequest(name: "My Private Reactor", type: "private")
{
Description = "Securely exchange token for another token",
Type = "private",
Icon = "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",
Code = @"
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY
module.exports = async function (req) {
// Do something with req.configuration.SERVICE_API_KEY

return {
raw: {
foo: 'bar'
}
};
return {
raw: {
foo: 'bar'
}
};
",
Configuration = new List<ReactorFormulaConfiguration> {
new ReactorFormulaConfiguration {
Name = "SERVICE_API_KEY",
Description = "Configuration description",
Type = "string"
}
},
RequestParameters = new List<ReactorFormulaRequestParameter> {
new ReactorFormulaRequestParameter {
Name = "request_parameter_1",
Description = "Request parameter description",
Type = "string"
},
new ReactorFormulaRequestParameter {
Name = "request_parameter_2",
Description = "Request parameter description",
Type = "boolean",
IsOptional = true
}
}
}
);
};
",
_Configuration =
[
new("SERVICE_API_KEY", type: "string")
{
Description = "Configuration description"
}
],
RequestParameters =
[
new("request_parameter_1", type: "string")
{
Description = "Request parameter description"
},

new("request_parameter_2", type: "boolean")
{
Description = "Request parameter description",
Optional = true
}
]
};

ReactorFormula result = apiInstance.Update(id, updateReactorFormulaRequest);
```

</TabItem>
Expand Down Expand Up @@ -1155,11 +1184,18 @@ await bt.reactorFormulas.delete("17069df1-80f4-439e-86a7-4121863e4678");
<TabItem value="csharp" label="C#">

```csharp showLineNumbers
using BasisTheory.net.ReactorFormulas;
using BasisTheory.net.Api;
using BasisTheory.net.Client;
using BasisTheory.net.Model;

Configuration config = new Configuration();
config.BasePath = "https://api.basistheory.com";
config.AddApiKey("BT-API-KEY", "YOUR_API_KEY");

var client = new ReactorFormulaClient("<MANAGEMENT_API_KEY>");
var apiInstance = new ReactorFormulasApi(config);
var id = "";

await client.DeleteAsync("17069df1-80f4-439e-86a7-4121863e4678");
apiInstance.Delete(id);
```

</TabItem>
Expand Down