Skip to content

Commit 73ca49c

Browse files
authored
Merge branch 'main' into patnir41/preconfig-difs-8-15
2 parents ea02ec2 + a4ac3bc commit 73ca49c

File tree

70 files changed

+3802
-2555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+3802
-2555
lines changed

README.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,40 @@ This repository contains:
2222

2323
We hope to help people who want to use Looker as a platform get up and running quickly, largely by providing pre-built client SDKs in the most popular languages, and implementing consistency across all languages and platforms.
2424

25-
An [OpenAPI specification](https://github.com/OAI/OpenAPI-Specification) describes the Looker API. This specification is used to produce both Looker's interactive API Explorer, and the Looker API language bindings for the Looker REST API.
25+
The Looker SDK has several parts:
2626

27-
A Looker SDK has several parts:
27+
- The **Looker API**, described by an [OpenAPI specification](https://github.com/OAI/OpenAPI-Specification) (e.g., the Swagger 2.x representation found at
28+
`https://<your-looker-domain>:19999/api/4.0/swagger.json`). The 4.0 API is our current & stable API. As of June 2022, [3.x is deprecated](https://developers.looker.com/api/advanced-usage/version-3x-deprecation).
2829

29-
- **Looker API** OpenAPI specification (e.g., found at
30-
`https://<your-looker-endpoint>:19999/api/3.1/swagger.json`, although this is still the Swagger 2.x representation)
30+
- The **Looker API Explorer**, an interactive reference, accessible either stand-alone at [developers.looker.com/api/explorer/](https://developers.looker.com/api/explorer/), or installable into your Looker instance as an extension from the Looker Marketplace.
3131

32-
- The **Looker API Docs viewer**, provided in the Looker web app directly from our version-specific OpenAPI specification, available on each Looker server instance.
32+
- **Language SDKs**, "smarter" client language classes and methods to improve the experience of calling the Looker API in various popular coding languages. Some SDKs are [Looker-supported](https://docs.looker.com/reference/api-and-integration/api-sdk-support-policy#support_levels) whereas others are community-supported.
3333

34-
- **Language SDKs**, "smarter" client language classes and methods to improve the experience of calling the Looker API in various popular coding languages.
34+
## SDK multi-API-version support
3535

36-
## Multi-API support with Looker 7.2 and later
36+
The 4.0 version of the API is the current and stable version of the API, in addition to the 3.x API which is now [deprecated](https://developers.looker.com/api/advanced-usage/version-3x-deprecation).
3737

38-
Looker 7.2 introduced an **Experimental** version of API 4.0. Since that release, some SDKs now support multiple API versions in the same SDK package.
38+
Some SDKs support and expose both API versions in the same SDK package, including all [Looker-supported SDKs](https://docs.looker.com/reference/api-and-integration/api-sdk-support-policy#language_sdks).
3939

40-
For all SDKs but Swift, API-specific SDKs are now created and put in the same SDK package, and share the same run-time code.
40+
For SDKs that support multiple API versions, there will be `methods.*` and `models.*` collections generated for each API version. Each API version is exposed under a distinct class name from which to instantiate an initial SDK object.
4141

42-
At the time of this writing, API 3.1 and API 4.0 are included in most SDK packages. For an SDK that supports multiple API versions, there will be a `methods.*` and `models.*` generated for each API version.
42+
API-version-specific files generally use shared Run-Time Library (RTL) code in the SDK package to minimize code duplication.
4343

44-
The class names representing these API versions are distinct, with version-named constructors for creating initialized SDK objects.
44+
Regardless of which API version you use, API credentials are unchanged, and may continue to be referred to as "API3" credentials.
4545

46-
These API-specific files still use all the same Run-Time Library (RTL) code in the SDK package to minimize code duplication.
4746

4847
### Looker SDKs
4948

5049
Please review the following table for a breakdown of the options to initialize the desired SDK object.
5150

52-
| SDK | API 3.1 | API 4.0 | Notes |
53-
| -------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
54-
| [Python](python) | `looker_sdk.init31()` | `looker_sdk.init40()` | Both API 3.1 and 4.0 are supported, and can be initialized with the functions shown |
55-
| [TypeScript](packages/sdk) | `Looker31SDK()`, `LookerNodeSDK.init31()`, or `LookerBrowserSDK.init31()` | `Looker40SDK()`, `LookerNodeSDK.init40()` or `LookerBrowserSDK.init40()` | Both API 3.1 and 4.0 are supported and can be initialized with the functions shown. **Important** - See information on the [typescript SDK dependencies](#very-important-note-regarding-the-looker-typescript-sdk) at the bottom of this file. |
56-
| [Kotlin](kotlin) | Do not use | `LookerSDK()` | API 4.0 was specifically created to correct the endpoint payloads for strongly-typed languages like Kotlin and Swift. Because Kotlin really requires API 4.0, API 4.0 is the default namespace for it |
57-
| [Swift](swift/looker) | Not applicable | `Looker40SDK()` | Swift only has SDK definitions for API 4.0 |
58-
| [Look#](csharp) | `Looker31SDK()` | `Looker40SDK()` | Community-supported C# SDK for Looker |
59-
| [GoLook](go) | Not applicable | `v4.NewLookerSDK()` | Community-supported GO SDK for Looker |
51+
| SDK | API 3.1 [(deprecated)](https://developers.looker.com/api/advanced-usage/version-3x-deprecation) | API 4.0 | Notes |
52+
| -------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
53+
| [Python](python) | `looker_sdk.init31()` | `looker_sdk.init40()` | |
54+
| [TypeScript](packages/sdk) | `Looker31SDK()`, `LookerNodeSDK.init31()`, or `LookerBrowserSDK.init31()` | `Looker40SDK()`, `LookerNodeSDK.init40()` or `LookerBrowserSDK.init40()` | **Important** - See information on the [typescript SDK dependencies](#very-important-note-regarding-the-looker-typescript-sdk) at the bottom of this file. |
55+
| [Kotlin](kotlin) | Not supported | `LookerSDK()` | Community-supported SDK. Uses API 4.0 exclusively. The initializer uses an unversioned name. |
56+
| [Swift](swift/looker) | Not supported | `Looker40SDK()` | Community-supported SDK. Uses API 4.0 exclusively. |
57+
| [Look#](csharp) | Not supported | `Looker40SDK()` | Community-supported SDK. Uses API 4.0 exclusively. |
58+
| [GoLook](go) | Not supported | `v4.NewLookerSDK()` | Community-supported SDK. Uses API 4.0 exclusively. |
6059

6160
By supporting both API versions in the same SDK package, we hope the migration path to the latest API is simplified. Both SDK versions can be used at the same time, in the same source file, which should allow for iterative work to move to the new API version.
6261

@@ -174,9 +173,7 @@ python
174173

175174
To generate a language currently not supported by Looker's SDK code generator with the OpenAPI generator:
176175

177-
- configure the desired language in [`codeGenerators.ts`](packages/sdk-codegen/src/codeGenerators.ts). Currently, only Go and C# have legacy language generation configured, and we now have a prototype Look# SDK that can be used instead of the legacy C# generator.
178-
179-
- the legacy generator defaults to using the API 4.0 specification, which is more accurate for strongly typed languages. To use API 3.1, put `api_version=3.1` in the `Looker` section of your `looker.ini`
176+
- configure the desired language in [`codeGenerators.ts`](packages/sdk-codegen/src/codeGenerators.ts).
180177

181178
- use `yarn legacy` to call the OpenAPI generator. This will use the OpenAPI generator to output files to the `./api/*` path
182179

@@ -281,7 +278,6 @@ The following table describes the environment variables. By default, the SDK "na
281278
| Variable name | Description |
282279
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
283280
| LOOKERSDK_BASE_URL | A URL like `https://my.looker.com:19999`. No default value. |
284-
| LOOKERSDK_API_VERSION | Version of the Looker API to use. Use `3.1` for now, which is the default and used to produce this SDK. |
285281
| LOOKERSDK_VERIFY_SSL | `true`, `t`, `yes`, `y`, or `1` (case insensitive) to enable SSL verification. Any other value is treated as `false`. Defaults to `true` if not set. |
286282
| LOOKERSDK_TIMEOUT | Request timeout in seconds. Defaults to `120` for most platforms. |
287283
| LOOKERSDK_CLIENT_ID | API3 credentials `client_id`. This and `client_secret` must be provided in some fashion to the Node SDK, or no calls to the API will be authorized. No default value. |

docs/byosdk.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ export const LookerAppId = 'x-looker-appid'
230230
this.authSession.settings.agentTag = `${agentPrefix} ${lookerVersion}.${this.apiVersion}`
231231
```
232232

233-
Where `lookerVersion` is the version of Looker (like 7.10) and `apiVersion` is (currently) either `3.1` or `4.0`.
233+
Where `lookerVersion` is the version of Looker (like 7.10) and `apiVersion` is (currently) either `4.0` or `3.1` ([deprecated](https://developers.looker.com/api/advanced-usage/version-3x-deprecation)).
234234

235-
This results in the agentTag appearing like `TS-SDK 7.10.3.1`.
235+
This results in the agentTag appearing like `TS-SDK 22.6.4.0`.
236236

237237
Additional attributes can be added to the agent tag by separating them with semicolons. (`;`)
238238

docs/json.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ We introduced API 4.0 to guarantee the JSON payload response types match the API
1414

1515
## Lookering forward
1616

17-
Current users of Looker SDKs may have noticed that some `id` properties are typed as `integer` and some are typed as `string`. For the stable (aka GA, generally available) release of API 4.0, all `id` references will be typed as `string`.
18-
Using strings for all ID references will allow Looker to scale out Looker services in the future, once ID generation does not require an auto-increment numeric ID value from a monolithic instance.
17+
Current users of Looker SDKs may have noticed that some `id` properties are typed as `integer` and some are typed as `string`. With the stable (aka GA, generally available) release of API 4.0, all `id` references have been typed as `string`.
18+
Using strings for all ID references allows Looker to scale out Looker services in the future, once ID generation does not require an auto-increment numeric ID value from a monolithic instance.
1919

2020
We have worked to minimize the impact of this type change for all Looker-provided language SDKs. This document describes some JSON parsing requirements and how our SDKs support them.
2121

examples/java/example_gradle/.env_sample

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
LOOKERSDK_BASE_URL=
2-
LOOKERSDK_API_VERSION=
32
LOOKERSDK_VERIFY_SSL=
43
LOOKERSDK_TIMEOUT=
54
LOOKERSDK_CLIENT_ID=

examples/java/example_maven/.env_sample

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
LOOKERSDK_BASE_URL=
2-
LOOKERSDK_API_VERSION=
32
LOOKERSDK_VERIFY_SSL=
43
LOOKERSDK_TIMEOUT=
54
LOOKERSDK_CLIENT_ID=

0 commit comments

Comments
 (0)