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

feat: regenerate Looker 22.12 SDKs #1177

Merged
merged 5 commits into from
Sep 21, 2022
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
47 changes: 43 additions & 4 deletions bin/sdk_gen
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
* create pull request https://docs.github.com/en/rest/pulls/pulls#create-a-pull-request
* */

const fs = require('fs')
const path = require('path')
const proc = require('child_process')
const looker = require('@looker/sdk-node')
const utf8 = { encoding: 'utf-8' }

const root = path.join(__dirname, '/../')
const sdk = looker.LookerNodeSDK.init40()
const releaseConfig = path.join(root, 'release-please-config.json')

async function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
Expand Down Expand Up @@ -68,14 +70,50 @@ const run = (command) => {
return result
}

/**
* Updates release-please-config.json to stamp the correct CalVer for the SDKs
*
* if `release-as` is already set, CalVer patch will be bumped if the current
* version is the same as the requested release version. Otherwise, it will be
* set to CalVer.0
*
* @param release Looker version
* @returns string describing CalVer action
*/
const releasePlease = (release) => {
const config = JSON.parse(fs.readFileSync(releaseConfig, utf8))
let newVer = `${release}.0`
const calVer = config[`release-as`]
if (calVer === newVer) {
const patch = parseInt(calVer.split('.')[2]) + 1
newVer = `${release}.${patch}`
}
config['release-as'] = newVer
fs.writeFileSync(releaseConfig, JSON.stringify(config, null, 2), utf8)
const result = `set release please calVer to ${newVer}`
console.info(result)
return result
}

/**
* Run multiple commands one after another, returning on first failure
* @param commands
*
* Array can contain both strings (which will be run commands) or functions
*
* Commands should return a string for success and an Error object for failure
*
* @param commands list of commands to run in sequence
* @param release CalVer of release, like 22.14
*/
const batch = (commands) => {
const batch = (commands, release) => {
let result = ''
for (const command of commands) {
result = run(command)
if (command instanceof Function) {
console.info('running a function ...')
result = command(release)
} else if (typeof command === 'string') {
result = run(command)
}
if (!ok(result)) {
console.error(`${command} failed.`)
return result
Expand Down Expand Up @@ -175,14 +213,15 @@ const regen = async (release) => {
const branch = branchActive()
if (await pullci(release)) {
return batch([
(release) => releasePlease(release),
'yarn gen',
'bin/smoke typescript python kotlin',
'git add -A',
`git commit -m "feat: generate SDKs for Looker ${release}"`,
`git push origin ${branch}`,
/* create PR
*/
])
], release)
} else {
console.error(`timed out waiting for Looker ${release}`)
}
Expand Down
2 changes: 1 addition & 1 deletion csharp/rtl/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public struct Constants

public const string DefaultApiVersion = "4.0";
public const string AgentPrefix = "CS-SDK";
public const string LookerVersion = "22.14";
public const string LookerVersion = "22.12";

public const string Bearer = "Bearer";
public const string LookerAppiId = "x-looker-appid";
Expand Down
4 changes: 1 addition & 3 deletions csharp/sdk/3.1/models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1169,8 +1169,6 @@ public class DBConnection : SdkModel
public long? pool_timeout { get; set; } = null;
/// <summary>(Read/Write) SQL Dialect name</summary>
public string? dialect_name { get; set; } = null;
/// <summary>Database connection has the ability to support open data studio from explore (read-only)</summary>
public bool? supports_data_studio_link { get; set; } = null;
/// <summary>Creation date for this connection (read-only)</summary>
public string? created_at { get; set; } = null;
/// <summary>Id of user who last modified this connection configuration (read-only)</summary>
Expand Down Expand Up @@ -4763,7 +4761,7 @@ public class WriteDatagroup : SdkModel
}

/// Dynamic writeable type for DBConnection removes:
/// can, dialect, snippets, pdts_enabled, uses_oauth, supports_data_studio_link, created_at, user_id, example, last_regen_at, last_reap_at, managed
/// can, dialect, snippets, pdts_enabled, uses_oauth, created_at, user_id, example, last_regen_at, last_reap_at, managed
public class WriteDBConnection : SdkModel
{
/// <summary>Name of the connection. Also used as the unique identifier</summary>
Expand Down
5 changes: 1 addition & 4 deletions csharp/sdk/4.0/methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,6 @@ public async Task<SdkResponse<Board, Exception>> create_board(
/// <param name="offset">The number of items to skip before returning any. (used with limit and takes priority over page and per_page)</param>
/// <param name="limit">The maximum number of items to return. (used with offset and takes priority over page and per_page)</param>
/// <param name="filter_or">Combine given search criteria in a boolean OR expression</param>
/// <param name="permission">Filter results based on permission, either show (default) or update</param>
public async Task<SdkResponse<Board[], Exception>> search_boards(
string? title = null,
string? created_at = null,
Expand All @@ -1396,7 +1395,6 @@ public async Task<SdkResponse<Board[], Exception>> search_boards(
long? offset = null,
long? limit = null,
bool? filter_or = null,
string? permission = null,
ITransportSettings? options = null)
{
return await AuthRequest<Board[], Exception>(HttpMethod.Get, "/boards/search", new Values {
Expand All @@ -1412,8 +1410,7 @@ public async Task<SdkResponse<Board[], Exception>> search_boards(
{ "per_page", per_page },
{ "offset", offset },
{ "limit", limit },
{ "filter_or", filter_or },
{ "permission", permission }},null,options);
{ "filter_or", filter_or }},null,options);
}

/// ### Get information about a board.
Expand Down
4 changes: 1 addition & 3 deletions csharp/sdk/4.0/models.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1554,8 +1554,6 @@ public class DBConnection : SdkModel
public long? pool_timeout { get; set; } = null;
/// <summary>(Read/Write) SQL Dialect name</summary>
public string? dialect_name { get; set; } = null;
/// <summary>Database connection has the ability to support open data studio from explore (read-only)</summary>
public bool? supports_data_studio_link { get; set; } = null;
/// <summary>Creation date for this connection (read-only)</summary>
public string? created_at { get; set; } = null;
/// <summary>Id of user who last modified this connection configuration (read-only)</summary>
Expand Down Expand Up @@ -5605,7 +5603,7 @@ public class WriteDatagroup : SdkModel
}

/// Dynamic writeable type for DBConnection removes:
/// can, dialect, snippets, pdts_enabled, uses_oauth, supports_data_studio_link, created_at, user_id, example, last_regen_at, last_reap_at, managed
/// can, dialect, snippets, pdts_enabled, uses_oauth, created_at, user_id, example, last_regen_at, last_reap_at, managed
public class WriteDBConnection : SdkModel
{
/// <summary>Name of the connection. Also used as the unique identifier</summary>
Expand Down
2 changes: 1 addition & 1 deletion go/sdk/v4/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ func (l *LookerSDK) CreateBoard(
func (l *LookerSDK) SearchBoards(request RequestSearchBoards,
options *rtl.ApiSettings) ([]Board, error) {
var result []Board
err := l.session.Do(&result, "GET", "/4.0", "/boards/search", map[string]interface{}{"title": request.Title, "created_at": request.CreatedAt, "first_name": request.FirstName, "last_name": request.LastName, "fields": request.Fields, "favorited": request.Favorited, "creator_id": request.CreatorId, "sorts": request.Sorts, "page": request.Page, "per_page": request.PerPage, "offset": request.Offset, "limit": request.Limit, "filter_or": request.FilterOr, "permission": request.Permission}, nil, options)
err := l.session.Do(&result, "GET", "/4.0", "/boards/search", map[string]interface{}{"title": request.Title, "created_at": request.CreatedAt, "first_name": request.FirstName, "last_name": request.LastName, "fields": request.Fields, "favorited": request.Favorited, "creator_id": request.CreatorId, "sorts": request.Sorts, "page": request.Page, "per_page": request.PerPage, "offset": request.Offset, "limit": request.Limit, "filter_or": request.FilterOr}, nil, options)
return result, err

}
Expand Down
30 changes: 14 additions & 16 deletions go/sdk/v4/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,6 @@ type DBConnection struct {
JdbcAdditionalParams *string `json:"jdbc_additional_params,omitempty"` // Additional params to add to JDBC connection string
PoolTimeout *int64 `json:"pool_timeout,omitempty"` // Connection Pool Timeout, in seconds
DialectName *string `json:"dialect_name,omitempty"` // (Read/Write) SQL Dialect name
SupportsDataStudioLink *bool `json:"supports_data_studio_link,omitempty"` // Database connection has the ability to support open data studio from explore
CreatedAt *string `json:"created_at,omitempty"` // Creation date for this connection
UserId *string `json:"user_id,omitempty"` // Id of user who last modified this connection configuration
Example *bool `json:"example,omitempty"` // Is this an example connection?
Expand Down Expand Up @@ -2595,20 +2594,19 @@ type RequestSearchAlerts struct {

// Dynamically generated request type for search_boards
type RequestSearchBoards struct {
Title *string `json:"title,omitempty"` // Matches board title.
CreatedAt *string `json:"created_at,omitempty"` // Matches the timestamp for when the board was created.
FirstName *string `json:"first_name,omitempty"` // The first name of the user who created this board.
LastName *string `json:"last_name,omitempty"` // The last name of the user who created this board.
Fields *string `json:"fields,omitempty"` // Requested fields.
Favorited *bool `json:"favorited,omitempty"` // Return favorited boards when true.
CreatorId *string `json:"creator_id,omitempty"` // Filter on boards created by a particular user.
Sorts *string `json:"sorts,omitempty"` // The fields to sort the results by
Page *int64 `json:"page,omitempty"` // The page to return. DEPRECATED. Use offset instead.
PerPage *int64 `json:"per_page,omitempty"` // The number of items in the returned page. DEPRECATED. Use limit instead.
Offset *int64 `json:"offset,omitempty"` // The number of items to skip before returning any. (used with limit and takes priority over page and per_page)
Limit *int64 `json:"limit,omitempty"` // The maximum number of items to return. (used with offset and takes priority over page and per_page)
FilterOr *bool `json:"filter_or,omitempty"` // Combine given search criteria in a boolean OR expression
Permission *string `json:"permission,omitempty"` // Filter results based on permission, either show (default) or update
Title *string `json:"title,omitempty"` // Matches board title.
CreatedAt *string `json:"created_at,omitempty"` // Matches the timestamp for when the board was created.
FirstName *string `json:"first_name,omitempty"` // The first name of the user who created this board.
LastName *string `json:"last_name,omitempty"` // The last name of the user who created this board.
Fields *string `json:"fields,omitempty"` // Requested fields.
Favorited *bool `json:"favorited,omitempty"` // Return favorited boards when true.
CreatorId *string `json:"creator_id,omitempty"` // Filter on boards created by a particular user.
Sorts *string `json:"sorts,omitempty"` // The fields to sort the results by
Page *int64 `json:"page,omitempty"` // The page to return. DEPRECATED. Use offset instead.
PerPage *int64 `json:"per_page,omitempty"` // The number of items in the returned page. DEPRECATED. Use limit instead.
Offset *int64 `json:"offset,omitempty"` // The number of items to skip before returning any. (used with limit and takes priority over page and per_page)
Limit *int64 `json:"limit,omitempty"` // The maximum number of items to return. (used with offset and takes priority over page and per_page)
FilterOr *bool `json:"filter_or,omitempty"` // Combine given search criteria in a boolean OR expression
}

// Dynamically generated request type for search_content_favorites
Expand Down Expand Up @@ -3825,7 +3823,7 @@ type WriteDatagroup struct {
}

// Dynamic writeable type for DBConnection removes:
// can, dialect, snippets, pdts_enabled, uses_oauth, supports_data_studio_link, created_at, user_id, example, last_regen_at, last_reap_at, managed
// can, dialect, snippets, pdts_enabled, uses_oauth, created_at, user_id, example, last_regen_at, last_reap_at, managed
type WriteDBConnection struct {
Name *string `json:"name,omitempty"` // Name of the connection. Also used as the unique identifier
Host *string `json:"host,omitempty"` // Host name/address of server
Expand Down
7 changes: 2 additions & 5 deletions kotlin/src/main/com/looker/sdk/4.0/methods.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,6 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) {
* @param {Long} offset The number of items to skip before returning any. (used with limit and takes priority over page and per_page)
* @param {Long} limit The maximum number of items to return. (used with offset and takes priority over page and per_page)
* @param {Boolean} filter_or Combine given search criteria in a boolean OR expression
* @param {String} permission Filter results based on permission, either show (default) or update
*
* GET /boards/search -> Array<Board>
*/
Expand All @@ -1418,8 +1417,7 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) {
per_page: Long? = null,
offset: Long? = null,
limit: Long? = null,
filter_or: Boolean? = null,
permission: String? = null
filter_or: Boolean? = null
) : SDKResponse {
return this.get<Array<Board>>("/boards/search",
mapOf("title" to title,
Expand All @@ -1434,8 +1432,7 @@ class LookerSDK(authSession: AuthSession) : APIMethods(authSession) {
"per_page" to per_page,
"offset" to offset,
"limit" to limit,
"filter_or" to filter_or,
"permission" to permission))
"filter_or" to filter_or))
}


Expand Down
4 changes: 1 addition & 3 deletions kotlin/src/main/com/looker/sdk/4.0/models.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,6 @@ data class Datagroup (
* @property jdbc_additional_params Additional params to add to JDBC connection string
* @property pool_timeout Connection Pool Timeout, in seconds
* @property dialect_name (Read/Write) SQL Dialect name
* @property supports_data_studio_link Database connection has the ability to support open data studio from explore (read-only)
* @property created_at Creation date for this connection (read-only)
* @property user_id Id of user who last modified this connection configuration (read-only)
* @property example Is this an example connection? (read-only)
Expand Down Expand Up @@ -1669,7 +1668,6 @@ data class DBConnection (
var jdbc_additional_params: String? = null,
var pool_timeout: Long? = null,
var dialect_name: String? = null,
var supports_data_studio_link: Boolean? = null,
var created_at: String? = null,
var user_id: String? = null,
var example: Boolean? = null,
Expand Down Expand Up @@ -5858,7 +5856,7 @@ data class WriteDatagroup (

/**
* Dynamic writeable type for DBConnection removes:
* can, dialect, snippets, pdts_enabled, uses_oauth, supports_data_studio_link, created_at, user_id, example, last_regen_at, last_reap_at, managed
* can, dialect, snippets, pdts_enabled, uses_oauth, created_at, user_id, example, last_regen_at, last_reap_at, managed
*
* @property name Name of the connection. Also used as the unique identifier
* @property host Host name/address of server
Expand Down
7 changes: 2 additions & 5 deletions kotlin/src/main/com/looker/sdk/4.0/streams.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,6 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) {
* @param {Long} offset The number of items to skip before returning any. (used with limit and takes priority over page and per_page)
* @param {Long} limit The maximum number of items to return. (used with offset and takes priority over page and per_page)
* @param {Boolean} filter_or Combine given search criteria in a boolean OR expression
* @param {String} permission Filter results based on permission, either show (default) or update
*
* GET /boards/search -> ByteArray
*/
Expand All @@ -1417,8 +1416,7 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) {
per_page: Long? = null,
offset: Long? = null,
limit: Long? = null,
filter_or: Boolean? = null,
permission: String? = null
filter_or: Boolean? = null
) : SDKResponse {
return this.get<ByteArray>("/boards/search",
mapOf("title" to title,
Expand All @@ -1433,8 +1431,7 @@ class LookerSDKStream(authSession: AuthSession) : APIMethods(authSession) {
"per_page" to per_page,
"offset" to offset,
"limit" to limit,
"filter_or" to filter_or,
"permission" to permission))
"filter_or" to filter_or))
}


Expand Down
2 changes: 1 addition & 1 deletion kotlin/src/main/com/looker/sdk/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ package com.looker.sdk

const val ENVIRONMENT_PREFIX = "LOOKERSDK"
const val SDK_TAG = "KT-SDK"
const val LOOKER_VERSION = "22.14"
const val LOOKER_VERSION = "22.12"
const val API_VERSION = "4.0"
const val AGENT_TAG = "$SDK_TAG $LOOKER_VERSION"
const val LOOKER_APPID = "x-looker-appid"
6 changes: 1 addition & 5 deletions packages/sdk/src/3.1/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1955,10 +1955,6 @@ export interface IDBConnection {
* (Read/Write) SQL Dialect name
*/
dialect_name?: string | null
/**
* Database connection has the ability to support open data studio from explore (read-only)
*/
supports_data_studio_link?: boolean
/**
* Creation date for this connection (read-only)
*/
Expand Down Expand Up @@ -9792,7 +9788,7 @@ export interface IWriteDatagroup {

/**
* Dynamic writeable type for DBConnection removes:
* can, dialect, snippets, pdts_enabled, uses_oauth, supports_data_studio_link, created_at, user_id, example, last_regen_at, last_reap_at, managed
* can, dialect, snippets, pdts_enabled, uses_oauth, created_at, user_id, example, last_regen_at, last_reap_at, managed
*/
export interface IWriteDBConnection {
/**
Expand Down
1 change: 0 additions & 1 deletion packages/sdk/src/4.0/funcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,6 @@ export const search_boards = async (
offset: request.offset,
limit: request.limit,
filter_or: request.filter_or,
permission: request.permission,
},
null,
options
Expand Down
1 change: 0 additions & 1 deletion packages/sdk/src/4.0/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2042,7 +2042,6 @@ export class Looker40SDK extends APIMethods implements ILooker40SDK {
offset: request.offset,
limit: request.limit,
filter_or: request.filter_or,
permission: request.permission,
},
null,
options
Expand Down
10 changes: 1 addition & 9 deletions packages/sdk/src/4.0/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2596,10 +2596,6 @@ export interface IDBConnection {
* (Read/Write) SQL Dialect name
*/
dialect_name?: string | null
/**
* Database connection has the ability to support open data studio from explore (read-only)
*/
supports_data_studio_link?: boolean
/**
* Creation date for this connection (read-only)
*/
Expand Down Expand Up @@ -7896,10 +7892,6 @@ export interface IRequestSearchBoards {
* Combine given search criteria in a boolean OR expression
*/
filter_or?: boolean | null
/**
* Filter results based on permission, either show (default) or update
*/
permission?: string | null
}

/**
Expand Down Expand Up @@ -11510,7 +11502,7 @@ export interface IWriteDatagroup {

/**
* Dynamic writeable type for DBConnection removes:
* can, dialect, snippets, pdts_enabled, uses_oauth, supports_data_studio_link, created_at, user_id, example, last_regen_at, last_reap_at, managed
* can, dialect, snippets, pdts_enabled, uses_oauth, created_at, user_id, example, last_regen_at, last_reap_at, managed
*/
export interface IWriteDBConnection {
/**
Expand Down
1 change: 0 additions & 1 deletion packages/sdk/src/4.0/streams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2330,7 +2330,6 @@ export class Looker40SDKStream extends APIMethods {
offset: request.offset,
limit: request.limit,
filter_or: request.filter_or,
permission: request.permission,
},
null,
options
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@

*/

export const sdkVersion = '22.14'
export const sdkVersion = '22.12'
export const environmentPrefix = 'LOOKERSDK'
Loading