All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.databricks.sdk.service.settings.TokensImpl Maven / Gradle / Ivy

There is a newer version: 0.35.0
Show newest version
// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
package com.databricks.sdk.service.settings;

import com.databricks.sdk.core.ApiClient;
import com.databricks.sdk.support.Generated;
import java.util.HashMap;
import java.util.Map;

/** Package-local implementation of Tokens */
@Generated
class TokensImpl implements TokensService {
  private final ApiClient apiClient;

  public TokensImpl(ApiClient apiClient) {
    this.apiClient = apiClient;
  }

  @Override
  public CreateTokenResponse create(CreateTokenRequest request) {
    String path = "/api/2.0/token/create";
    Map headers = new HashMap<>();
    headers.put("Accept", "application/json");
    headers.put("Content-Type", "application/json");
    return apiClient.POST(path, request, CreateTokenResponse.class, headers);
  }

  @Override
  public void delete(RevokeTokenRequest request) {
    String path = "/api/2.0/token/delete";
    Map headers = new HashMap<>();
    headers.put("Accept", "application/json");
    headers.put("Content-Type", "application/json");
    apiClient.POST(path, request, RevokeTokenResponse.class, headers);
  }

  @Override
  public ListPublicTokensResponse list() {
    String path = "/api/2.0/token/list";
    Map headers = new HashMap<>();
    headers.put("Accept", "application/json");
    return apiClient.GET(path, ListPublicTokensResponse.class, headers);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy