Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 20 additions & 0 deletions official/docs/csharp/current/api-keys/create.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Threading.Tasks;
using EasyPost;
using EasyPost.Models.API;
using Newtonsoft.Json;

namespace EasyPostExamples
{
public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

ApiKey apiKey = await client.ApiKey.Create("test");

Console.WriteLine(JsonConvert.SerializeObject(apiKey, Formatting.Indented));
}
}
}
15 changes: 15 additions & 0 deletions official/docs/csharp/current/api-keys/delete.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Threading.Tasks;
using EasyPost;

namespace EasyPostExamples
{
public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

await client.ApiKey.Delete("ak_...");
}
}
}
20 changes: 20 additions & 0 deletions official/docs/csharp/current/api-keys/disable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Threading.Tasks;
using EasyPost;
using EasyPost.Models.API;
using Newtonsoft.Json;

namespace EasyPostExamples
{
public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

ApiKey apiKey = await client.ApiKey.Disable("ak_...");

Console.WriteLine(JsonConvert.SerializeObject(apiKey, Formatting.Indented));
}
}
}
20 changes: 20 additions & 0 deletions official/docs/csharp/current/api-keys/enable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Threading.Tasks;
using EasyPost;
using EasyPost.Models.API;
using Newtonsoft.Json;

namespace EasyPostExamples
{
public class Examples
{
public static async Task Main()
{
var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

ApiKey apiKey = await client.ApiKey.Enable("ak_...");

Console.WriteLine(JsonConvert.SerializeObject(apiKey, Formatting.Indented));
}
}
}
15 changes: 15 additions & 0 deletions official/docs/golang/current/api-keys/create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package example

import (
"fmt"

"github.com/EasyPost/easypost-go/v5"
)

func create() {
client := easypost.New("EASYPOST_API_KEY")

apiKey, _ := client.CreateAPIKey("test")

fmt.Println(apiKey)
Comment thread
Justintime50 marked this conversation as resolved.
Dismissed
}
15 changes: 15 additions & 0 deletions official/docs/golang/current/api-keys/delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package example

import (
"fmt"

"github.com/EasyPost/easypost-go/v5"
)

func delete() {
client := easypost.New("EASYPOST_API_KEY")

err := client.DeleteAPIKey("ak_...")

fmt.Println(err)
}
15 changes: 15 additions & 0 deletions official/docs/golang/current/api-keys/disable.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package example

import (
"fmt"

"github.com/EasyPost/easypost-go/v5"
)

func disable() {
client := easypost.New("EASYPOST_API_KEY")

apiKey, _ := client.DisableAPIKey("ak_...")

fmt.Println(apiKey)
Comment thread
Justintime50 marked this conversation as resolved.
Dismissed
}
15 changes: 15 additions & 0 deletions official/docs/golang/current/api-keys/enable.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package example

import (
"fmt"

"github.com/EasyPost/easypost-go/v5"
)

func enable() {
client := easypost.New("EASYPOST_API_KEY")

apiKey, _ := client.EnableAPIKey("ak_...")

fmt.Println(apiKey)
Comment thread
Justintime50 marked this conversation as resolved.
Dismissed
}
15 changes: 15 additions & 0 deletions official/docs/java/current/api-keys/create.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package api_keys;

import com.easypost.exception.EasyPostException;
import com.easypost.model.ApiKey;
import com.easypost.service.EasyPostClient;

public class Create {
public static void main(String[] args) throws EasyPostException {
EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");

ApiKey apiKey = client.apiKey.create("test");

System.out.println(apiKey);
}
}
12 changes: 12 additions & 0 deletions official/docs/java/current/api-keys/delete.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package api_keys;

import com.easypost.exception.EasyPostException;
import com.easypost.service.EasyPostClient;

public class Delete {
public static void main(String[] args) throws EasyPostException {
EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");

client.apiKey.delete("ak_...");
}
}
15 changes: 15 additions & 0 deletions official/docs/java/current/api-keys/disable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package api_keys;

import com.easypost.exception.EasyPostException;
import com.easypost.model.ApiKey;
import com.easypost.service.EasyPostClient;

public class Disable {
public static void main(String[] args) throws EasyPostException {
EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");

ApiKey apiKey = client.apiKey.disable("ak_...");

System.out.println(apiKey);
}
}
15 changes: 15 additions & 0 deletions official/docs/java/current/api-keys/enable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package api_keys;

import com.easypost.exception.EasyPostException;
import com.easypost.model.ApiKey;
import com.easypost.service.EasyPostClient;

public class Enable {
public static void main(String[] args) throws EasyPostException {
EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");

ApiKey apiKey = client.apiKey.enable("ak_...");

System.out.println(apiKey);
}
}
9 changes: 9 additions & 0 deletions official/docs/node/current/api-keys/create.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const EasyPostClient = require('@easypost/api');

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
const apiKey = await client.ApiKey.create('test');

console.log(apiKey);
Comment thread
Justintime50 marked this conversation as resolved.
Dismissed
})();
7 changes: 7 additions & 0 deletions official/docs/node/current/api-keys/delete.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const EasyPostClient = require('@easypost/api');

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
await client.ApiKey.delete('ak_...');
})();
9 changes: 9 additions & 0 deletions official/docs/node/current/api-keys/disable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const EasyPostClient = require('@easypost/api');

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
const apiKey = await client.ApiKey.disable('ak_...');

console.log(apiKey);
Comment thread
Justintime50 marked this conversation as resolved.
Dismissed
})();
9 changes: 9 additions & 0 deletions official/docs/node/current/api-keys/enable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const EasyPostClient = require('@easypost/api');

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
const apiKey = await client.ApiKey.enable('ak_...');

console.log(apiKey);
Comment thread
Justintime50 marked this conversation as resolved.
Dismissed
})();
7 changes: 7 additions & 0 deletions official/docs/php/current/api-keys/create.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY');

$apiKey = $client->apiKeys->create('test');

echo $apiKey;
5 changes: 5 additions & 0 deletions official/docs/php/current/api-keys/delete.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY');

$client->apiKeys->delete('ak_...');
7 changes: 7 additions & 0 deletions official/docs/php/current/api-keys/disable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY');

$apiKey = $client->apiKeys->disable('ak_...');

echo $apiKey;
7 changes: 7 additions & 0 deletions official/docs/php/current/api-keys/enable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY');

$apiKey = $client->apiKeys->enable('ak_...');

echo $apiKey;
7 changes: 7 additions & 0 deletions official/docs/python/current/api-keys/create.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

api_key = client.api_keys.create(mode="test")

print(api_key)
Comment thread
Justintime50 marked this conversation as resolved.
Dismissed
5 changes: 5 additions & 0 deletions official/docs/python/current/api-keys/delete.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

client.api_keys.delete("ak_...")
7 changes: 7 additions & 0 deletions official/docs/python/current/api-keys/disable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

api_key = client.api_keys.disable("ak_...")

print(api_key)
Comment thread
Justintime50 marked this conversation as resolved.
Dismissed
7 changes: 7 additions & 0 deletions official/docs/python/current/api-keys/enable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

api_key = client.api_keys.enable("ak_...")

print(api_key)
Comment thread
Justintime50 marked this conversation as resolved.
Dismissed
4 changes: 2 additions & 2 deletions official/docs/responses/api-keys/create.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"object": "ApiKey",
"key": "<REDACTED>",
"mode": "test",
"created_at": "2022-01-29T00:02:36Z",
"created_at": "2026-10-01T17:19:24Z",
"active": true,
"id": "ak_..."
"id": "ak_a092e6149cdc4c3da65cc62b10ba46a1"
}
4 changes: 2 additions & 2 deletions official/docs/responses/api-keys/disable.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"object": "ApiKey",
"key": "<REDACTED>",
"mode": "test",
"created_at": "2022-01-29T00:02:36Z",
"created_at": "2026-10-01T17:19:26Z",
"active": false,
"id": "ak_..."
"id": "ak_3628513daaa248f487b2184419964b11"
}
4 changes: 2 additions & 2 deletions official/docs/responses/api-keys/enable.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"object": "ApiKey",
"key": "<REDACTED>",
"mode": "test",
"created_at": "2022-01-29T00:02:36Z",
"created_at": "2026-10-01T17:19:25Z",
"active": true,
"id": "ak_..."
"id": "ak_0b001461ee0842ee9dad6e14ad437b54"
}
7 changes: 7 additions & 0 deletions official/docs/ruby/current/api-keys/create.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'easypost'

client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY')

api_key = client.api_key.create('test')

puts api_key
5 changes: 5 additions & 0 deletions official/docs/ruby/current/api-keys/delete.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'easypost'

client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY')

client.api_key.delete('ak_...')
7 changes: 7 additions & 0 deletions official/docs/ruby/current/api-keys/disable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'easypost'

client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY')

api_key = client.api_key.disable('ak_...')

puts api_key
7 changes: 7 additions & 0 deletions official/docs/ruby/current/api-keys/enable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'easypost'

client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY')

api_key = client.api_key.enable('ak_...')

puts api_key
Loading
Loading