From 6c6bdcff12175e38566892431c32b7d07fb70e42 Mon Sep 17 00:00:00 2001 From: Madhav Sainanee Date: Fri, 17 Oct 2025 11:18:15 +0000 Subject: [PATCH 1/8] token federation for go --- auth/oauth/oauth.go | 2 + auth/tokenprovider/authenticator.go | 44 +++ auth/tokenprovider/authenticator_test.go | 135 +++++++ auth/tokenprovider/cached.go | 86 ++++ auth/tokenprovider/exchange.go | 372 ++++++++++++++++++ auth/tokenprovider/external.go | 56 +++ auth/tokenprovider/federation_test.go | 348 +++++++++++++++++ auth/tokenprovider/provider.go | 43 ++ auth/tokenprovider/provider_test.go | 423 ++++++++++++++++++++ auth/tokenprovider/static.go | 47 +++ connector.go | 53 +++ examples/browser_oauth_federation/main.go | 454 ++++++++++++++++++++++ examples/token_federation/main.go | 344 ++++++++++++++++ go.mod | 5 +- go.sum | 11 + 15 files changed, 2422 insertions(+), 1 deletion(-) create mode 100644 auth/tokenprovider/authenticator.go create mode 100644 auth/tokenprovider/authenticator_test.go create mode 100644 auth/tokenprovider/cached.go create mode 100644 auth/tokenprovider/exchange.go create mode 100644 auth/tokenprovider/external.go create mode 100644 auth/tokenprovider/federation_test.go create mode 100644 auth/tokenprovider/provider.go create mode 100644 auth/tokenprovider/provider_test.go create mode 100644 auth/tokenprovider/static.go create mode 100644 examples/browser_oauth_federation/main.go create mode 100644 examples/token_federation/main.go diff --git a/auth/oauth/oauth.go b/auth/oauth/oauth.go index 0df9d5c4..80313fa2 100644 --- a/auth/oauth/oauth.go +++ b/auth/oauth/oauth.go @@ -85,6 +85,8 @@ var databricksAWSDomains []string = []string{ } var databricksAzureDomains []string = []string{ + ".staging.azuredatabricks.net", + ".dev.azuredatabricks.net", ".azuredatabricks.net", ".databricks.azure.cn", ".databricks.azure.us", diff --git a/auth/tokenprovider/authenticator.go b/auth/tokenprovider/authenticator.go new file mode 100644 index 00000000..42b574c0 --- /dev/null +++ b/auth/tokenprovider/authenticator.go @@ -0,0 +1,44 @@ +package tokenprovider + +import ( + "context" + "fmt" + "net/http" + + "github.com/databricks/databricks-sql-go/auth" + "github.com/rs/zerolog/log" +) + +// TokenProviderAuthenticator implements auth.Authenticator using a TokenProvider +type TokenProviderAuthenticator struct { + provider TokenProvider +} + +// NewAuthenticator creates an authenticator from a token provider +func NewAuthenticator(provider TokenProvider) auth.Authenticator { + return &TokenProviderAuthenticator{ + provider: provider, + } +} + +// Authenticate implements auth.Authenticator +func (a *TokenProviderAuthenticator) Authenticate(r *http.Request) error { + ctx := r.Context() + if ctx == nil { + ctx = context.Background() + } + + token, err := a.provider.GetToken(ctx) + if err != nil { + return fmt.Errorf("token provider authenticator: failed to get token: %w", err) + } + + if token.AccessToken == "" { + return fmt.Errorf("token provider authenticator: empty access token") + } + + token.SetAuthHeader(r) + log.Debug().Msgf("token provider authenticator: authenticated using provider %s", a.provider.Name()) + + return nil +} \ No newline at end of file diff --git a/auth/tokenprovider/authenticator_test.go b/auth/tokenprovider/authenticator_test.go new file mode 100644 index 00000000..c5a43392 --- /dev/null +++ b/auth/tokenprovider/authenticator_test.go @@ -0,0 +1,135 @@ +package tokenprovider + +import ( + "context" + "errors" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestTokenProviderAuthenticator(t *testing.T) { + t.Run("successful_authentication", func(t *testing.T) { + provider := NewStaticTokenProvider("test-token-123") + authenticator := NewAuthenticator(provider) + + req, _ := http.NewRequest("GET", "http://example.com", nil) + err := authenticator.Authenticate(req) + + require.NoError(t, err) + assert.Equal(t, "Bearer test-token-123", req.Header.Get("Authorization")) + }) + + t.Run("authentication_with_custom_token_type", func(t *testing.T) { + provider := NewStaticTokenProviderWithType("test-token", "MAC") + authenticator := NewAuthenticator(provider) + + req, _ := http.NewRequest("GET", "http://example.com", nil) + err := authenticator.Authenticate(req) + + require.NoError(t, err) + assert.Equal(t, "MAC test-token", req.Header.Get("Authorization")) + }) + + t.Run("authentication_error_propagation", func(t *testing.T) { + provider := &mockProvider{ + tokenFunc: func() (*Token, error) { + return nil, errors.New("provider failed") + }, + } + authenticator := NewAuthenticator(provider) + + req, _ := http.NewRequest("GET", "http://example.com", nil) + err := authenticator.Authenticate(req) + + assert.Error(t, err) + assert.Contains(t, err.Error(), "provider failed") + assert.Empty(t, req.Header.Get("Authorization")) + }) + + t.Run("empty_token_error", func(t *testing.T) { + provider := &mockProvider{ + tokenFunc: func() (*Token, error) { + return &Token{ + AccessToken: "", + TokenType: "Bearer", + }, nil + }, + } + authenticator := NewAuthenticator(provider) + + req, _ := http.NewRequest("GET", "http://example.com", nil) + err := authenticator.Authenticate(req) + + assert.Error(t, err) + assert.Contains(t, err.Error(), "empty access token") + assert.Empty(t, req.Header.Get("Authorization")) + }) + + t.Run("uses_request_context", func(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + cancel() // Cancel immediately + + provider := &mockProvider{ + tokenFunc: func() (*Token, error) { + // This would normally check context cancellation + return &Token{ + AccessToken: "test-token", + TokenType: "Bearer", + }, nil + }, + } + authenticator := NewAuthenticator(provider) + + req, _ := http.NewRequestWithContext(ctx, "GET", "http://example.com", nil) + err := authenticator.Authenticate(req) + + // Even with cancelled context, this should work as our mock doesn't check it + require.NoError(t, err) + assert.Equal(t, "Bearer test-token", req.Header.Get("Authorization")) + }) + + t.Run("external_token_integration", func(t *testing.T) { + tokenFunc := func() (string, error) { + return "external-token-456", nil + } + provider := NewExternalTokenProvider(tokenFunc) + authenticator := NewAuthenticator(provider) + + req, _ := http.NewRequest("POST", "http://example.com/api", nil) + err := authenticator.Authenticate(req) + + require.NoError(t, err) + assert.Equal(t, "Bearer external-token-456", req.Header.Get("Authorization")) + }) + + t.Run("cached_provider_integration", func(t *testing.T) { + callCount := 0 + baseProvider := &mockProvider{ + tokenFunc: func() (*Token, error) { + callCount++ + return &Token{ + AccessToken: "cached-token", + TokenType: "Bearer", + }, nil + }, + name: "test", + } + + cachedProvider := NewCachedTokenProvider(baseProvider) + authenticator := NewAuthenticator(cachedProvider) + + // Multiple authentication attempts + for i := 0; i < 3; i++ { + req, _ := http.NewRequest("GET", "http://example.com", nil) + err := authenticator.Authenticate(req) + require.NoError(t, err) + assert.Equal(t, "Bearer cached-token", req.Header.Get("Authorization")) + } + + // Should only call base provider once due to caching + assert.Equal(t, 1, callCount) + }) +} \ No newline at end of file diff --git a/auth/tokenprovider/cached.go b/auth/tokenprovider/cached.go new file mode 100644 index 00000000..585a1ea1 --- /dev/null +++ b/auth/tokenprovider/cached.go @@ -0,0 +1,86 @@ +package tokenprovider + +import ( + "context" + "fmt" + "sync" + "time" + + "github.com/rs/zerolog/log" +) + +// CachedTokenProvider wraps another provider and caches tokens +type CachedTokenProvider struct { + provider TokenProvider + cache *Token + mutex sync.RWMutex + // RefreshThreshold determines when to refresh (default 5 minutes before expiry) + RefreshThreshold time.Duration +} + +// NewCachedTokenProvider creates a caching wrapper around any token provider +func NewCachedTokenProvider(provider TokenProvider) *CachedTokenProvider { + return &CachedTokenProvider{ + provider: provider, + RefreshThreshold: 5 * time.Minute, + } +} + +// GetToken retrieves a token, using cache if available and valid +func (p *CachedTokenProvider) GetToken(ctx context.Context) (*Token, error) { + // Try to get from cache first + p.mutex.RLock() + cached := p.cache + p.mutex.RUnlock() + + if cached != nil && !p.shouldRefresh(cached) { + log.Debug().Msgf("cached token provider: using cached token for provider %s", p.provider.Name()) + return cached, nil + } + + // Need to refresh + p.mutex.Lock() + defer p.mutex.Unlock() + + // Double-check after acquiring write lock + if p.cache != nil && !p.shouldRefresh(p.cache) { + return p.cache, nil + } + + log.Debug().Msgf("cached token provider: fetching new token from provider %s", p.provider.Name()) + token, err := p.provider.GetToken(ctx) + if err != nil { + return nil, fmt.Errorf("cached token provider: failed to get token: %w", err) + } + + p.cache = token + return token, nil +} + +// shouldRefresh determines if a token should be refreshed +func (p *CachedTokenProvider) shouldRefresh(token *Token) bool { + if token == nil { + return true + } + + // If no expiry time, assume token doesn't expire + if token.ExpiresAt.IsZero() { + return false + } + + // Refresh if within threshold of expiry + refreshAt := token.ExpiresAt.Add(-p.RefreshThreshold) + return time.Now().After(refreshAt) +} + +// Name returns the provider name +func (p *CachedTokenProvider) Name() string { + return fmt.Sprintf("cached[%s]", p.provider.Name()) +} + +// ClearCache clears the cached token +func (p *CachedTokenProvider) ClearCache() { + p.mutex.Lock() + p.cache = nil + p.mutex.Unlock() +} \ No newline at end of file diff --git a/auth/tokenprovider/exchange.go b/auth/tokenprovider/exchange.go new file mode 100644 index 00000000..5120fe42 --- /dev/null +++ b/auth/tokenprovider/exchange.go @@ -0,0 +1,372 @@ +package tokenprovider + +import ( + "context" + "crypto/x509" + "encoding/json" + "encoding/pem" + "fmt" + "io" + "net/http" + "net/url" + "strings" + "time" + + "github.com/golang-jwt/jwt/v5" + "github.com/rs/zerolog/log" +) + +// FederationProvider wraps another token provider and automatically handles token exchange +type FederationProvider struct { + baseProvider TokenProvider + databricksHost string + clientID string // For SP-wide federation + httpClient *http.Client + // Settings for token exchange + returnOriginalTokenIfAuthenticated bool +} + +// NewFederationProvider creates a federation provider that wraps another provider +// It automatically detects when token exchange is needed and falls back gracefully +func NewFederationProvider(baseProvider TokenProvider, databricksHost string) *FederationProvider { + return &FederationProvider{ + baseProvider: baseProvider, + databricksHost: databricksHost, + httpClient: &http.Client{Timeout: 30 * time.Second}, + returnOriginalTokenIfAuthenticated: true, + } +} + +// NewFederationProviderWithClientID creates a provider for SP-wide federation (M2M) +func NewFederationProviderWithClientID(baseProvider TokenProvider, databricksHost, clientID string) *FederationProvider { + return &FederationProvider{ + baseProvider: baseProvider, + databricksHost: databricksHost, + clientID: clientID, + httpClient: &http.Client{Timeout: 30 * time.Second}, + returnOriginalTokenIfAuthenticated: true, + } +} + +// GetToken gets token from base provider and exchanges if needed +func (p *FederationProvider) GetToken(ctx context.Context) (*Token, error) { + // Get token from base provider + baseToken, err := p.baseProvider.GetToken(ctx) + if err != nil { + return nil, fmt.Errorf("federation provider: failed to get base token: %w", err) + } + + // Check if token is a JWT and needs exchange + if p.needsTokenExchange(baseToken.AccessToken) { + log.Debug().Msgf("federation provider: attempting token exchange for %s", p.baseProvider.Name()) + + // Try token exchange + exchangedToken, err := p.tryTokenExchange(ctx, baseToken.AccessToken) + if err != nil { + log.Warn().Err(err).Msg("federation provider: token exchange failed, using original token") + return baseToken, nil // Fall back to original token + } + + log.Debug().Msg("federation provider: token exchange successful") + return exchangedToken, nil + } + + // Use original token + return baseToken, nil +} + +// needsTokenExchange determines if a token needs exchange by checking if it's from a different issuer +func (p *FederationProvider) needsTokenExchange(tokenString string) bool { + // Try to parse as JWT + token, _, err := new(jwt.Parser).ParseUnverified(tokenString, jwt.MapClaims{}) + if err != nil { + log.Debug().Err(err).Msg("federation provider: not a JWT token, skipping exchange") + return false + } + + claims, ok := token.Claims.(jwt.MapClaims) + if !ok { + return false + } + + issuer, ok := claims["iss"].(string) + if !ok { + return false + } + + // Check if issuer is different from Databricks host + return !p.isSameHost(issuer, p.databricksHost) +} + +// tryTokenExchange attempts to exchange the token with Databricks +func (p *FederationProvider) tryTokenExchange(ctx context.Context, subjectToken string) (*Token, error) { + // Build exchange URL - add scheme if not present + exchangeURL := p.databricksHost + if !strings.HasPrefix(exchangeURL, "http://") && !strings.HasPrefix(exchangeURL, "https://") { + exchangeURL = "https://" + exchangeURL + } + if !strings.HasSuffix(exchangeURL, "/") { + exchangeURL += "/" + } + exchangeURL += "oidc/v1/token" + + // Prepare form data for token exchange + data := url.Values{} + data.Set("grant_type", "urn:ietf:params:oauth:grant-type:token-exchange") + data.Set("scope", "sql") + data.Set("subject_token_type", "urn:ietf:params:oauth:token-type:jwt") + data.Set("subject_token", subjectToken) + + if p.returnOriginalTokenIfAuthenticated { + data.Set("return_original_token_if_authenticated", "true") + } + + // Add client_id for SP-wide federation + if p.clientID != "" { + data.Set("client_id", p.clientID) + } + + // Create request + req, err := http.NewRequestWithContext(ctx, "POST", exchangeURL, strings.NewReader(data.Encode())) + if err != nil { + return nil, fmt.Errorf("failed to create request: %w", err) + } + + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + req.Header.Set("Accept", "*/*") + + // Make request + resp, err := p.httpClient.Do(req) + if err != nil { + return nil, fmt.Errorf("request failed: %w", err) + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("failed to read response: %w", err) + } + + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("exchange failed with status %d: %s", resp.StatusCode, string(body)) + } + + // Parse response + var tokenResp struct { + AccessToken string `json:"access_token"` + TokenType string `json:"token_type"` + ExpiresIn int `json:"expires_in"` + Scope string `json:"scope"` + } + + if err := json.Unmarshal(body, &tokenResp); err != nil { + return nil, fmt.Errorf("failed to parse response: %w", err) + } + + token := &Token{ + AccessToken: tokenResp.AccessToken, + TokenType: tokenResp.TokenType, + Scopes: strings.Fields(tokenResp.Scope), + } + + if tokenResp.ExpiresIn > 0 { + token.ExpiresAt = time.Now().Add(time.Duration(tokenResp.ExpiresIn) * time.Second) + } + + return token, nil +} + +// isSameHost compares two URLs to see if they have the same host +// This matches Python's behavior: ignores port differences (e.g., :443 vs no port for HTTPS) +func (p *FederationProvider) isSameHost(url1, url2 string) bool { + // Add scheme to url2 if it doesn't have one (databricksHost may not have scheme) + parsedURL2 := url2 + if !strings.HasPrefix(url2, "http://") && !strings.HasPrefix(url2, "https://") { + parsedURL2 = "https://" + url2 + } + + u1, err1 := url.Parse(url1) + u2, err2 := url.Parse(parsedURL2) + + if err1 != nil || err2 != nil { + return false + } + + // Use Hostname() instead of Host to ignore port differences + // This handles cases like "host.com:443" == "host.com" for HTTPS + return u1.Hostname() == u2.Hostname() +} + +// Name returns the provider name +func (p *FederationProvider) Name() string { + baseName := p.baseProvider.Name() + if p.clientID != "" { + return fmt.Sprintf("federation[%s,sp:%s]", baseName, p.clientID[:8]) // Truncate client ID for readability + } + return fmt.Sprintf("federation[%s]", baseName) +} + +// JWTProvider creates tokens from JWT credentials (for M2M flows) +type JWTProvider struct { + clientID string + privateKey interface{} + tokenURL string + scopes []string + audience string + keyID string + httpClient *http.Client + jwtExpiration time.Duration +} + +// NewJWTProvider creates a provider that uses JWT assertion for M2M authentication +func NewJWTProvider(clientID, tokenURL string, privateKey interface{}) *JWTProvider { + return &JWTProvider{ + clientID: clientID, + privateKey: privateKey, + tokenURL: tokenURL, + scopes: []string{"sql"}, + httpClient: &http.Client{Timeout: 30 * time.Second}, + jwtExpiration: 5 * time.Minute, + } +} + +// WithScopes sets the OAuth scopes +func (p *JWTProvider) WithScopes(scopes []string) *JWTProvider { + p.scopes = scopes + return p +} + +// WithAudience sets the JWT audience +func (p *JWTProvider) WithAudience(audience string) *JWTProvider { + p.audience = audience + return p +} + +// WithKeyID sets the JWT key ID +func (p *JWTProvider) WithKeyID(keyID string) *JWTProvider { + p.keyID = keyID + return p +} + +// GetToken creates a JWT assertion and exchanges it for an access token +func (p *JWTProvider) GetToken(ctx context.Context) (*Token, error) { + // Create JWT assertion + jwtToken, err := p.createJWTAssertion() + if err != nil { + return nil, fmt.Errorf("jwt provider: failed to create JWT assertion: %w", err) + } + + // Exchange JWT for access token + return p.exchangeJWTForToken(ctx, jwtToken) +} + +// createJWTAssertion creates a JWT assertion for client credentials flow +func (p *JWTProvider) createJWTAssertion() (string, error) { + now := time.Now() + claims := jwt.MapClaims{ + "iss": p.clientID, + "sub": p.clientID, + "aud": p.audience, + "iat": now.Unix(), + "exp": now.Add(p.jwtExpiration).Unix(), + } + + token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) + + if p.keyID != "" { + token.Header["kid"] = p.keyID + } + + return token.SignedString(p.privateKey) +} + +// exchangeJWTForToken exchanges JWT assertion for access token +func (p *JWTProvider) exchangeJWTForToken(ctx context.Context, jwtAssertion string) (*Token, error) { + data := url.Values{} + data.Set("grant_type", "client_credentials") + data.Set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer") + data.Set("client_assertion", jwtAssertion) + data.Set("scope", strings.Join(p.scopes, " ")) + + req, err := http.NewRequestWithContext(ctx, "POST", p.tokenURL, strings.NewReader(data.Encode())) + if err != nil { + return nil, fmt.Errorf("failed to create request: %w", err) + } + + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + resp, err := p.httpClient.Do(req) + if err != nil { + return nil, fmt.Errorf("request failed: %w", err) + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, fmt.Errorf("failed to read response: %w", err) + } + + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("token request failed with status %d: %s", resp.StatusCode, string(body)) + } + + var tokenResp struct { + AccessToken string `json:"access_token"` + TokenType string `json:"token_type"` + ExpiresIn int `json:"expires_in"` + Scope string `json:"scope"` + } + + if err := json.Unmarshal(body, &tokenResp); err != nil { + return nil, fmt.Errorf("failed to parse response: %w", err) + } + + token := &Token{ + AccessToken: tokenResp.AccessToken, + TokenType: tokenResp.TokenType, + Scopes: strings.Fields(tokenResp.Scope), + } + + if tokenResp.ExpiresIn > 0 { + token.ExpiresAt = time.Now().Add(time.Duration(tokenResp.ExpiresIn) * time.Second) + } + + return token, nil +} + +// Name returns the provider name +func (p *JWTProvider) Name() string { + return "jwt-assertion" +} + +// ParsePrivateKeyFromPEM parses a private key from PEM format +func ParsePrivateKeyFromPEM(pemData []byte, passphrase string) (interface{}, error) { + block, _ := pem.Decode(pemData) + if block == nil { + return nil, fmt.Errorf("failed to decode PEM block") + } + + var keyBytes []byte + var err error + + if passphrase != "" && x509.IsEncryptedPEMBlock(block) { + keyBytes, err = x509.DecryptPEMBlock(block, []byte(passphrase)) + if err != nil { + return nil, fmt.Errorf("failed to decrypt PEM block: %w", err) + } + } else { + keyBytes = block.Bytes + } + + // Try parsing as PKCS1 RSA private key first + if key, err := x509.ParsePKCS1PrivateKey(keyBytes); err == nil { + return key, nil + } + + // Try parsing as PKCS8 private key + if key, err := x509.ParsePKCS8PrivateKey(keyBytes); err == nil { + return key, nil + } + + return nil, fmt.Errorf("unsupported private key format") +} \ No newline at end of file diff --git a/auth/tokenprovider/external.go b/auth/tokenprovider/external.go new file mode 100644 index 00000000..3cf6570f --- /dev/null +++ b/auth/tokenprovider/external.go @@ -0,0 +1,56 @@ +package tokenprovider + +import ( + "context" + "fmt" + "time" +) + +// ExternalTokenProvider provides tokens from an external source (passthrough) +type ExternalTokenProvider struct { + tokenFunc func() (string, error) + tokenType string +} + +// NewExternalTokenProvider creates a provider that gets tokens from an external function +func NewExternalTokenProvider(tokenFunc func() (string, error)) *ExternalTokenProvider { + return &ExternalTokenProvider{ + tokenFunc: tokenFunc, + tokenType: "Bearer", + } +} + +// NewExternalTokenProviderWithType creates a provider with a custom token type +func NewExternalTokenProviderWithType(tokenFunc func() (string, error), tokenType string) *ExternalTokenProvider { + return &ExternalTokenProvider{ + tokenFunc: tokenFunc, + tokenType: tokenType, + } +} + +// GetToken retrieves the token from the external source +func (p *ExternalTokenProvider) GetToken(ctx context.Context) (*Token, error) { + if p.tokenFunc == nil { + return nil, fmt.Errorf("external token provider: token function is nil") + } + + accessToken, err := p.tokenFunc() + if err != nil { + return nil, fmt.Errorf("external token provider: failed to get token: %w", err) + } + + if accessToken == "" { + return nil, fmt.Errorf("external token provider: empty token returned") + } + + return &Token{ + AccessToken: accessToken, + TokenType: p.tokenType, + ExpiresAt: time.Time{}, // External tokens don't provide expiry info + }, nil +} + +// Name returns the provider name +func (p *ExternalTokenProvider) Name() string { + return "external" +} \ No newline at end of file diff --git a/auth/tokenprovider/federation_test.go b/auth/tokenprovider/federation_test.go new file mode 100644 index 00000000..3db1aea6 --- /dev/null +++ b/auth/tokenprovider/federation_test.go @@ -0,0 +1,348 @@ +package tokenprovider + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "testing" + "time" + + "github.com/golang-jwt/jwt/v5" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// Helper function to create JWT tokens for testing +func createTestJWT(issuer, audience string, expiryHours int) string { + claims := jwt.MapClaims{ + "iss": issuer, + "aud": audience, + "exp": time.Now().Add(time.Duration(expiryHours) * time.Hour).Unix(), + "sub": "test-user", + } + token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) + tokenString, _ := token.SignedString([]byte("test-secret")) + return tokenString +} + +func TestFederationProvider_HostComparison(t *testing.T) { + tests := []struct { + name string + issuer string + databricksHost string + shouldExchange bool + }{ + { + name: "same_host_no_port", + issuer: "https://test.databricks.com", + databricksHost: "test.databricks.com", + shouldExchange: false, + }, + { + name: "same_host_with_port_443", + issuer: "https://test.databricks.com:443", + databricksHost: "test.databricks.com", + shouldExchange: false, + }, + { + name: "same_host_both_with_port", + issuer: "https://test.databricks.com:443", + databricksHost: "test.databricks.com:443", + shouldExchange: false, + }, + { + name: "different_host_azure", + issuer: "https://login.microsoftonline.com/tenant-id/", + databricksHost: "test.databricks.com", + shouldExchange: true, + }, + { + name: "different_host_google", + issuer: "https://accounts.google.com", + databricksHost: "test.databricks.com", + shouldExchange: true, + }, + { + name: "different_host_aws", + issuer: "https://cognito-identity.amazonaws.com", + databricksHost: "test.databricks.com", + shouldExchange: true, + }, + { + name: "different_databricks_host", + issuer: "https://test1.databricks.com", + databricksHost: "test2.databricks.com", + shouldExchange: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Create a JWT token with the specified issuer + jwtToken := createTestJWT(tt.issuer, "databricks", 1) + + // Create a mock base provider + baseProvider := NewStaticTokenProvider(jwtToken) + + // Create federation provider + fedProvider := NewFederationProvider(baseProvider, tt.databricksHost) + + // Check if token needs exchange + needsExchange := fedProvider.needsTokenExchange(jwtToken) + assert.Equal(t, tt.shouldExchange, needsExchange, + "issuer=%s, host=%s, expected shouldExchange=%v, got=%v", + tt.issuer, tt.databricksHost, tt.shouldExchange, needsExchange) + }) + } +} + +func TestFederationProvider_TokenExchangeSuccess(t *testing.T) { + // Create mock token exchange server + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + // Verify request method and path + assert.Equal(t, "POST", r.Method) + assert.Contains(t, r.URL.Path, "/oidc/v1/token") + + // Verify headers + assert.Equal(t, "application/x-www-form-urlencoded", r.Header.Get("Content-Type")) + assert.Equal(t, "*/*", r.Header.Get("Accept")) + + // Parse form data + err := r.ParseForm() + require.NoError(t, err) + + // Verify form parameters + assert.Equal(t, "urn:ietf:params:oauth:grant-type:token-exchange", r.FormValue("grant_type")) + assert.Equal(t, "sql", r.FormValue("scope")) + assert.Equal(t, "urn:ietf:params:oauth:token-type:jwt", r.FormValue("subject_token_type")) + assert.NotEmpty(t, r.FormValue("subject_token")) + assert.Equal(t, "true", r.FormValue("return_original_token_if_authenticated")) + + // Return successful token response + response := map[string]interface{}{ + "access_token": "exchanged-databricks-token", + "token_type": "Bearer", + "expires_in": 3600, + "scope": "sql", + } + w.Header().Set("Content-Type", "application/json") + json.NewEncoder(w).Encode(response) + })) + defer server.Close() + + // Create external token with different issuer + externalToken := createTestJWT("https://login.microsoftonline.com/tenant-id/", "databricks", 1) + baseProvider := NewStaticTokenProvider(externalToken) + + // Create federation provider pointing to mock server + // Use full URL including http:// scheme for test server + fedProvider := NewFederationProvider(baseProvider, server.URL) + + // Get token - should trigger exchange + ctx := context.Background() + token, err := fedProvider.GetToken(ctx) + + require.NoError(t, err) + assert.Equal(t, "exchanged-databricks-token", token.AccessToken) + assert.Equal(t, "Bearer", token.TokenType) + assert.False(t, token.ExpiresAt.IsZero()) + assert.Contains(t, token.Scopes, "sql") +} + +func TestFederationProvider_TokenExchangeWithClientID(t *testing.T) { + clientID := "test-client-id-12345" + + // Create mock server that checks for client_id + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + err := r.ParseForm() + require.NoError(t, err) + + // Verify client_id is present + assert.Equal(t, clientID, r.FormValue("client_id")) + + response := map[string]interface{}{ + "access_token": "sp-wide-federation-token", + "token_type": "Bearer", + "expires_in": 3600, + } + w.Header().Set("Content-Type", "application/json") + json.NewEncoder(w).Encode(response) + })) + defer server.Close() + + externalToken := createTestJWT("https://login.microsoftonline.com/tenant-id/", "databricks", 1) + baseProvider := NewStaticTokenProvider(externalToken) + + fedProvider := NewFederationProviderWithClientID(baseProvider, server.URL, clientID) + + ctx := context.Background() + token, err := fedProvider.GetToken(ctx) + + require.NoError(t, err) + assert.Equal(t, "sp-wide-federation-token", token.AccessToken) +} + +func TestFederationProvider_TokenExchangeFailureFallback(t *testing.T) { + // Create mock server that returns error + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusBadRequest) + w.Write([]byte(`{"error": "invalid_request"}`)) + })) + defer server.Close() + + externalToken := createTestJWT("https://login.microsoftonline.com/tenant-id/", "databricks", 1) + baseProvider := NewStaticTokenProvider(externalToken) + + fedProvider := NewFederationProvider(baseProvider, server.URL) + + ctx := context.Background() + token, err := fedProvider.GetToken(ctx) + + // Should not error - falls back to external token + require.NoError(t, err) + assert.Equal(t, externalToken, token.AccessToken, "Should fall back to original token on exchange failure") + assert.Equal(t, "Bearer", token.TokenType) +} + +func TestFederationProvider_NoExchangeWhenSameIssuer(t *testing.T) { + // Create token with Databricks as issuer + databricksHost := "test.databricks.com" + databricksToken := createTestJWT("https://"+databricksHost, "databricks", 1) + baseProvider := NewStaticTokenProvider(databricksToken) + + fedProvider := NewFederationProvider(baseProvider, databricksHost) + + ctx := context.Background() + token, err := fedProvider.GetToken(ctx) + + // Should not exchange - just return original token + require.NoError(t, err) + assert.Equal(t, databricksToken, token.AccessToken, "Should use original token when issuer matches") +} + +func TestFederationProvider_NonJWTToken(t *testing.T) { + // Use a non-JWT token (e.g., opaque PAT) + opaqueToken := "dapi1234567890abcdef" + baseProvider := NewStaticTokenProvider(opaqueToken) + + fedProvider := NewFederationProvider(baseProvider, "test.databricks.com") + + ctx := context.Background() + token, err := fedProvider.GetToken(ctx) + + // Should not error - just pass through non-JWT token + require.NoError(t, err) + assert.Equal(t, opaqueToken, token.AccessToken, "Should pass through non-JWT tokens") +} + +func TestFederationProvider_ProviderName(t *testing.T) { + baseProvider := NewStaticTokenProvider("test-token") + + t.Run("without_client_id", func(t *testing.T) { + fedProvider := NewFederationProvider(baseProvider, "test.databricks.com") + assert.Equal(t, "federation[static]", fedProvider.Name()) + }) + + t.Run("with_client_id", func(t *testing.T) { + fedProvider := NewFederationProviderWithClientID(baseProvider, "test.databricks.com", "client-12345678-more") + // Should truncate client ID to first 8 chars + assert.Equal(t, "federation[static,sp:client-1]", fedProvider.Name()) + }) +} + +func TestFederationProvider_CachedIntegration(t *testing.T) { + callCount := 0 + exchangeCount := 0 + + // Mock server that counts exchanges + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + exchangeCount++ + response := map[string]interface{}{ + "access_token": "databricks-token", + "token_type": "Bearer", + "expires_in": 3600, + } + w.Header().Set("Content-Type", "application/json") + json.NewEncoder(w).Encode(response) + })) + defer server.Close() + + // External provider that counts calls + externalProvider := &mockProvider{ + tokenFunc: func() (*Token, error) { + callCount++ + externalToken := createTestJWT("https://login.microsoftonline.com/tenant/", "databricks", 1) + return &Token{ + AccessToken: externalToken, + TokenType: "Bearer", + ExpiresAt: time.Now().Add(1 * time.Hour), + }, nil + }, + name: "external", + } + + fedProvider := NewFederationProvider(externalProvider, server.URL) + cachedProvider := NewCachedTokenProvider(fedProvider) + + ctx := context.Background() + + // First call - should call external provider and exchange + token1, err1 := cachedProvider.GetToken(ctx) + require.NoError(t, err1) + assert.Equal(t, "databricks-token", token1.AccessToken) + assert.Equal(t, 1, callCount, "External provider should be called once") + assert.Equal(t, 1, exchangeCount, "Token should be exchanged once") + + // Second call - should use cache + token2, err2 := cachedProvider.GetToken(ctx) + require.NoError(t, err2) + assert.Equal(t, "databricks-token", token2.AccessToken) + assert.Equal(t, 1, callCount, "External provider should still be called only once (cached)") + assert.Equal(t, 1, exchangeCount, "Token should still be exchanged only once (cached)") +} + +func TestFederationProvider_InvalidJWT(t *testing.T) { + // Test with various invalid JWT formats + testCases := []string{ + "not.a.jwt", + "invalid-token-format", + "", + } + + for _, invalidToken := range testCases { + t.Run("invalid_jwt_"+invalidToken, func(t *testing.T) { + baseProvider := NewStaticTokenProvider(invalidToken) + fedProvider := NewFederationProvider(baseProvider, "test.databricks.com") + + // Should not need exchange for invalid JWT + needsExchange := fedProvider.needsTokenExchange(invalidToken) + assert.False(t, needsExchange, "Invalid JWT should not require exchange") + }) + } +} + +func TestFederationProvider_RealWorldIssuers(t *testing.T) { + // Test with real-world identity provider issuers + issuers := map[string]string{ + "azure_ad": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "google": "https://accounts.google.com", + "aws_cognito": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_example", + "okta": "https://dev-12345.okta.com/oauth2/default", + "auth0": "https://dev-12345.auth0.com/", + "github": "https://token.actions.githubusercontent.com", + } + + databricksHost := "test.databricks.com" + + for name, issuer := range issuers { + t.Run(name, func(t *testing.T) { + jwtToken := createTestJWT(issuer, "databricks", 1) + baseProvider := NewStaticTokenProvider(jwtToken) + fedProvider := NewFederationProvider(baseProvider, databricksHost) + + needsExchange := fedProvider.needsTokenExchange(jwtToken) + assert.True(t, needsExchange, "Token from %s should require exchange", name) + }) + } +} diff --git a/auth/tokenprovider/provider.go b/auth/tokenprovider/provider.go new file mode 100644 index 00000000..911b0bc5 --- /dev/null +++ b/auth/tokenprovider/provider.go @@ -0,0 +1,43 @@ +package tokenprovider + +import ( + "context" + "net/http" + "time" +) + +// TokenProvider is the interface for providing tokens from various sources +type TokenProvider interface { + // GetToken retrieves a valid access token + GetToken(ctx context.Context) (*Token, error) + + // Name returns the provider name for logging/debugging + Name() string +} + +// Token represents an access token with metadata +type Token struct { + AccessToken string + TokenType string + ExpiresAt time.Time + RefreshToken string + Scopes []string +} + +// IsExpired checks if the token has expired +func (t *Token) IsExpired() bool { + if t.ExpiresAt.IsZero() { + return false // No expiry means token doesn't expire + } + // Consider token expired 5 minutes before actual expiry for safety + return time.Now().Add(5 * time.Minute).After(t.ExpiresAt) +} + +// SetAuthHeader sets the Authorization header on an HTTP request +func (t *Token) SetAuthHeader(r *http.Request) { + tokenType := t.TokenType + if tokenType == "" { + tokenType = "Bearer" + } + r.Header.Set("Authorization", tokenType+" "+t.AccessToken) +} \ No newline at end of file diff --git a/auth/tokenprovider/provider_test.go b/auth/tokenprovider/provider_test.go new file mode 100644 index 00000000..0fd59034 --- /dev/null +++ b/auth/tokenprovider/provider_test.go @@ -0,0 +1,423 @@ +package tokenprovider + +import ( + "context" + "errors" + "net/http" + "sync" + "sync/atomic" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestToken_IsExpired(t *testing.T) { + tests := []struct { + name string + token *Token + expected bool + }{ + { + name: "token_without_expiry", + token: &Token{ + AccessToken: "test-token", + ExpiresAt: time.Time{}, + }, + expected: false, + }, + { + name: "token_expired", + token: &Token{ + AccessToken: "test-token", + ExpiresAt: time.Now().Add(-10 * time.Minute), + }, + expected: true, + }, + { + name: "token_not_expired", + token: &Token{ + AccessToken: "test-token", + ExpiresAt: time.Now().Add(10 * time.Minute), + }, + expected: false, + }, + { + name: "token_expires_within_5_minutes", + token: &Token{ + AccessToken: "test-token", + ExpiresAt: time.Now().Add(3 * time.Minute), + }, + expected: true, // Should be considered expired due to 5-minute buffer + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equal(t, tt.expected, tt.token.IsExpired()) + }) + } +} + +func TestToken_SetAuthHeader(t *testing.T) { + tests := []struct { + name string + token *Token + expectedHeader string + }{ + { + name: "bearer_token", + token: &Token{ + AccessToken: "test-access-token", + TokenType: "Bearer", + }, + expectedHeader: "Bearer test-access-token", + }, + { + name: "default_to_bearer", + token: &Token{ + AccessToken: "test-access-token", + TokenType: "", + }, + expectedHeader: "Bearer test-access-token", + }, + { + name: "custom_token_type", + token: &Token{ + AccessToken: "test-access-token", + TokenType: "CustomAuth", + }, + expectedHeader: "CustomAuth test-access-token", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + req, _ := http.NewRequest("GET", "http://example.com", nil) + tt.token.SetAuthHeader(req) + assert.Equal(t, tt.expectedHeader, req.Header.Get("Authorization")) + }) + } +} + +func TestStaticTokenProvider(t *testing.T) { + t.Run("valid_token", func(t *testing.T) { + provider := NewStaticTokenProvider("static-token-123") + token, err := provider.GetToken(context.Background()) + + require.NoError(t, err) + assert.Equal(t, "static-token-123", token.AccessToken) + assert.Equal(t, "Bearer", token.TokenType) + assert.True(t, token.ExpiresAt.IsZero()) + assert.Equal(t, "static", provider.Name()) + }) + + t.Run("empty_token_error", func(t *testing.T) { + provider := NewStaticTokenProvider("") + token, err := provider.GetToken(context.Background()) + + assert.Error(t, err) + assert.Nil(t, token) + assert.Contains(t, err.Error(), "token is empty") + }) + + t.Run("custom_token_type", func(t *testing.T) { + provider := NewStaticTokenProviderWithType("static-token", "CustomAuth") + token, err := provider.GetToken(context.Background()) + + require.NoError(t, err) + assert.Equal(t, "static-token", token.AccessToken) + assert.Equal(t, "CustomAuth", token.TokenType) + }) + + t.Run("multiple_calls_same_token", func(t *testing.T) { + provider := NewStaticTokenProvider("static-token") + + token1, err1 := provider.GetToken(context.Background()) + token2, err2 := provider.GetToken(context.Background()) + + require.NoError(t, err1) + require.NoError(t, err2) + assert.Equal(t, token1.AccessToken, token2.AccessToken) + }) +} + +func TestExternalTokenProvider(t *testing.T) { + t.Run("successful_token_retrieval", func(t *testing.T) { + callCount := 0 + tokenFunc := func() (string, error) { + callCount++ + return "external-token-" + string(rune(callCount)), nil + } + + provider := NewExternalTokenProvider(tokenFunc) + token, err := provider.GetToken(context.Background()) + + require.NoError(t, err) + assert.Equal(t, "external-token-\x01", token.AccessToken) + assert.Equal(t, "Bearer", token.TokenType) + assert.Equal(t, "external", provider.Name()) + }) + + t.Run("token_function_error", func(t *testing.T) { + tokenFunc := func() (string, error) { + return "", errors.New("failed to retrieve token") + } + + provider := NewExternalTokenProvider(tokenFunc) + token, err := provider.GetToken(context.Background()) + + assert.Error(t, err) + assert.Nil(t, token) + assert.Contains(t, err.Error(), "failed to get token") + }) + + t.Run("empty_token_error", func(t *testing.T) { + tokenFunc := func() (string, error) { + return "", nil + } + + provider := NewExternalTokenProvider(tokenFunc) + token, err := provider.GetToken(context.Background()) + + assert.Error(t, err) + assert.Nil(t, token) + assert.Contains(t, err.Error(), "empty token returned") + }) + + t.Run("nil_function_error", func(t *testing.T) { + provider := NewExternalTokenProvider(nil) + token, err := provider.GetToken(context.Background()) + + assert.Error(t, err) + assert.Nil(t, token) + assert.Contains(t, err.Error(), "token function is nil") + }) + + t.Run("custom_token_type", func(t *testing.T) { + tokenFunc := func() (string, error) { + return "external-token", nil + } + + provider := NewExternalTokenProviderWithType(tokenFunc, "MAC") + token, err := provider.GetToken(context.Background()) + + require.NoError(t, err) + assert.Equal(t, "external-token", token.AccessToken) + assert.Equal(t, "MAC", token.TokenType) + }) + + t.Run("different_token_each_call", func(t *testing.T) { + counter := 0 + tokenFunc := func() (string, error) { + counter++ + return "token-" + string(rune(counter)), nil + } + + provider := NewExternalTokenProvider(tokenFunc) + + token1, err1 := provider.GetToken(context.Background()) + token2, err2 := provider.GetToken(context.Background()) + + require.NoError(t, err1) + require.NoError(t, err2) + assert.NotEqual(t, token1.AccessToken, token2.AccessToken) + assert.Equal(t, "token-\x01", token1.AccessToken) + assert.Equal(t, "token-\x02", token2.AccessToken) + }) +} + +func TestCachedTokenProvider(t *testing.T) { + t.Run("caches_valid_token", func(t *testing.T) { + callCount := 0 + baseProvider := &mockProvider{ + tokenFunc: func() (*Token, error) { + callCount++ + return &Token{ + AccessToken: "cached-token", + TokenType: "Bearer", + ExpiresAt: time.Now().Add(1 * time.Hour), + }, nil + }, + name: "mock", + } + + cachedProvider := NewCachedTokenProvider(baseProvider) + + // First call - should fetch from base provider + token1, err1 := cachedProvider.GetToken(context.Background()) + require.NoError(t, err1) + assert.Equal(t, "cached-token", token1.AccessToken) + assert.Equal(t, 1, callCount) + + // Second call - should use cache + token2, err2 := cachedProvider.GetToken(context.Background()) + require.NoError(t, err2) + assert.Equal(t, "cached-token", token2.AccessToken) + assert.Equal(t, 1, callCount) // Should still be 1 + }) + + t.Run("refreshes_expired_token", func(t *testing.T) { + callCount := 0 + baseProvider := &mockProvider{ + tokenFunc: func() (*Token, error) { + callCount++ + // Return token that expires soon + return &Token{ + AccessToken: "token-" + string(rune(callCount)), + TokenType: "Bearer", + ExpiresAt: time.Now().Add(2 * time.Minute), // Within refresh threshold + }, nil + }, + name: "mock", + } + + cachedProvider := NewCachedTokenProvider(baseProvider) + cachedProvider.RefreshThreshold = 5 * time.Minute + + // First call + token1, err1 := cachedProvider.GetToken(context.Background()) + require.NoError(t, err1) + assert.Equal(t, "token-\x01", token1.AccessToken) + assert.Equal(t, 1, callCount) + + // Second call - should refresh because token expires within threshold + token2, err2 := cachedProvider.GetToken(context.Background()) + require.NoError(t, err2) + assert.Equal(t, "token-\x02", token2.AccessToken) + assert.Equal(t, 2, callCount) + }) + + t.Run("handles_provider_error", func(t *testing.T) { + baseProvider := &mockProvider{ + tokenFunc: func() (*Token, error) { + return nil, errors.New("provider error") + }, + name: "mock", + } + + cachedProvider := NewCachedTokenProvider(baseProvider) + token, err := cachedProvider.GetToken(context.Background()) + + assert.Error(t, err) + assert.Nil(t, token) + assert.Contains(t, err.Error(), "provider error") + }) + + t.Run("no_expiry_token_not_refreshed", func(t *testing.T) { + callCount := 0 + baseProvider := &mockProvider{ + tokenFunc: func() (*Token, error) { + callCount++ + return &Token{ + AccessToken: "permanent-token", + TokenType: "Bearer", + ExpiresAt: time.Time{}, // No expiry + }, nil + }, + name: "mock", + } + + cachedProvider := NewCachedTokenProvider(baseProvider) + + // Multiple calls should all use cache + for i := 0; i < 5; i++ { + token, err := cachedProvider.GetToken(context.Background()) + require.NoError(t, err) + assert.Equal(t, "permanent-token", token.AccessToken) + } + + assert.Equal(t, 1, callCount) // Should only be called once + }) + + t.Run("clear_cache", func(t *testing.T) { + callCount := 0 + baseProvider := &mockProvider{ + tokenFunc: func() (*Token, error) { + callCount++ + return &Token{ + AccessToken: "token-" + string(rune(callCount)), + TokenType: "Bearer", + ExpiresAt: time.Now().Add(1 * time.Hour), + }, nil + }, + name: "mock", + } + + cachedProvider := NewCachedTokenProvider(baseProvider) + + // First call + token1, _ := cachedProvider.GetToken(context.Background()) + assert.Equal(t, "token-\x01", token1.AccessToken) + assert.Equal(t, 1, callCount) + + // Clear cache + cachedProvider.ClearCache() + + // Next call should fetch new token + token2, _ := cachedProvider.GetToken(context.Background()) + assert.Equal(t, "token-\x02", token2.AccessToken) + assert.Equal(t, 2, callCount) + }) + + t.Run("concurrent_access", func(t *testing.T) { + var callCount atomic.Int32 + baseProvider := &mockProvider{ + tokenFunc: func() (*Token, error) { + // Simulate slow token fetch + time.Sleep(100 * time.Millisecond) + callCount.Add(1) + return &Token{ + AccessToken: "concurrent-token", + TokenType: "Bearer", + ExpiresAt: time.Now().Add(1 * time.Hour), + }, nil + }, + name: "mock", + } + + cachedProvider := NewCachedTokenProvider(baseProvider) + + // Launch multiple goroutines + var wg sync.WaitGroup + for i := 0; i < 10; i++ { + wg.Add(1) + go func() { + defer wg.Done() + token, err := cachedProvider.GetToken(context.Background()) + assert.NoError(t, err) + assert.Equal(t, "concurrent-token", token.AccessToken) + }() + } + + wg.Wait() + + // Should only fetch token once despite concurrent access + assert.Equal(t, int32(1), callCount.Load()) + }) + + t.Run("provider_name", func(t *testing.T) { + baseProvider := &mockProvider{name: "test-provider"} + cachedProvider := NewCachedTokenProvider(baseProvider) + + assert.Equal(t, "cached[test-provider]", cachedProvider.Name()) + }) +} + +// Mock provider for testing +type mockProvider struct { + tokenFunc func() (*Token, error) + name string +} + +func (m *mockProvider) GetToken(ctx context.Context) (*Token, error) { + if m.tokenFunc != nil { + return m.tokenFunc() + } + return nil, errors.New("not implemented") +} + +func (m *mockProvider) Name() string { + return m.name +} \ No newline at end of file diff --git a/auth/tokenprovider/static.go b/auth/tokenprovider/static.go new file mode 100644 index 00000000..0ff265e4 --- /dev/null +++ b/auth/tokenprovider/static.go @@ -0,0 +1,47 @@ +package tokenprovider + +import ( + "context" + "fmt" + "time" +) + +// StaticTokenProvider provides a static token that never changes +type StaticTokenProvider struct { + token string + tokenType string +} + +// NewStaticTokenProvider creates a provider with a static token +func NewStaticTokenProvider(token string) *StaticTokenProvider { + return &StaticTokenProvider{ + token: token, + tokenType: "Bearer", + } +} + +// NewStaticTokenProviderWithType creates a provider with a static token and custom type +func NewStaticTokenProviderWithType(token string, tokenType string) *StaticTokenProvider { + return &StaticTokenProvider{ + token: token, + tokenType: tokenType, + } +} + +// GetToken returns the static token +func (p *StaticTokenProvider) GetToken(ctx context.Context) (*Token, error) { + if p.token == "" { + return nil, fmt.Errorf("static token provider: token is empty") + } + + return &Token{ + AccessToken: p.token, + TokenType: p.tokenType, + ExpiresAt: time.Time{}, // Static tokens don't expire + }, nil +} + +// Name returns the provider name +func (p *StaticTokenProvider) Name() string { + return "static" +} \ No newline at end of file diff --git a/connector.go b/connector.go index 21a5f178..2b5cac60 100644 --- a/connector.go +++ b/connector.go @@ -12,6 +12,7 @@ import ( "github.com/databricks/databricks-sql-go/auth" "github.com/databricks/databricks-sql-go/auth/oauth/m2m" "github.com/databricks/databricks-sql-go/auth/pat" + "github.com/databricks/databricks-sql-go/auth/tokenprovider" "github.com/databricks/databricks-sql-go/driverctx" dbsqlerr "github.com/databricks/databricks-sql-go/errors" "github.com/databricks/databricks-sql-go/internal/cli_service" @@ -274,3 +275,55 @@ func WithClientCredentials(clientID, clientSecret string) ConnOption { } } } + +// WithTokenProvider sets up authentication using a custom token provider +func WithTokenProvider(provider tokenprovider.TokenProvider) ConnOption { + return func(c *config.Config) { + if provider != nil { + c.Authenticator = tokenprovider.NewAuthenticator(provider) + } + } +} + +// WithExternalToken sets up authentication using an external token function (passthrough) +func WithExternalToken(tokenFunc func() (string, error)) ConnOption { + return func(c *config.Config) { + if tokenFunc != nil { + provider := tokenprovider.NewExternalTokenProvider(tokenFunc) + c.Authenticator = tokenprovider.NewAuthenticator(provider) + } + } +} + +// WithStaticToken sets up authentication using a static token +func WithStaticToken(token string) ConnOption { + return func(c *config.Config) { + if token != "" { + provider := tokenprovider.NewStaticTokenProvider(token) + c.Authenticator = tokenprovider.NewAuthenticator(provider) + } + } +} + +// WithFederatedTokenProvider sets up authentication using token federation +// It wraps the base provider and automatically handles token exchange if needed +func WithFederatedTokenProvider(baseProvider tokenprovider.TokenProvider) ConnOption { + return func(c *config.Config) { + if baseProvider != nil { + // Wrap with federation provider that auto-detects need for token exchange + federationProvider := tokenprovider.NewFederationProvider(baseProvider, c.Host) + c.Authenticator = tokenprovider.NewAuthenticator(federationProvider) + } + } +} + +// WithFederatedTokenProviderAndClientID sets up SP-wide token federation +func WithFederatedTokenProviderAndClientID(baseProvider tokenprovider.TokenProvider, clientID string) ConnOption { + return func(c *config.Config) { + if baseProvider != nil { + // Wrap with federation provider for SP-wide federation + federationProvider := tokenprovider.NewFederationProviderWithClientID(baseProvider, c.Host, clientID) + c.Authenticator = tokenprovider.NewAuthenticator(federationProvider) + } + } +} diff --git a/examples/browser_oauth_federation/main.go b/examples/browser_oauth_federation/main.go new file mode 100644 index 00000000..760ba48c --- /dev/null +++ b/examples/browser_oauth_federation/main.go @@ -0,0 +1,454 @@ +package main + +import ( + "context" + "database/sql" + "encoding/json" + "fmt" + "io" + "log" + "net/http" + "net/url" + "os" + "strings" + "time" + + dbsql "github.com/databricks/databricks-sql-go" + "github.com/databricks/databricks-sql-go/auth/oauth/u2m" + "github.com/databricks/databricks-sql-go/auth/tokenprovider" + "github.com/joho/godotenv" +) + +func main() { + err := godotenv.Load() + if err != nil { + log.Printf("Warning: .env file not found: %v", err) + } + + fmt.Println("Browser OAuth with Token Federation Test") + fmt.Println("=========================================") + fmt.Println() + + // Get test mode from environment + testMode := os.Getenv("TEST_MODE") + if testMode == "" { + fmt.Println("TEST_MODE not set. Available modes:") + fmt.Println(" passthrough - Account-wide WIF Auth_Flow=0 (Token passthrough)") + fmt.Println(" u2m_federation - Account-wide WIF Auth_Flow=2 (U2M with federation)") + fmt.Println(" u2m_native - Native U2M without federation (baseline)") + fmt.Println(" external_token - Manual token passthrough (for testing exchange)") + os.Exit(1) + } + + switch testMode { + case "passthrough": + testTokenPassthrough() + case "u2m_federation": + testU2MWithFederation() + case "u2m_native": + testU2MNative() + case "external_token": + testExternalTokenWithFederation() + default: + log.Fatalf("Unknown test mode: %s", testMode) + } +} + +// testU2MNative tests native U2M OAuth without token federation (baseline) +func testU2MNative() { + fmt.Println("Test: Native U2M OAuth (Baseline - No Federation)") + fmt.Println("--------------------------------------------------") + fmt.Println("This uses Databricks' built-in OAuth without token exchange") + fmt.Println() + + host := os.Getenv("DATABRICKS_HOST") + httpPath := os.Getenv("DATABRICKS_HTTPPATH") + + if host == "" || httpPath == "" { + log.Fatal("DATABRICKS_HOST and DATABRICKS_HTTPPATH must be set") + } + + fmt.Printf("Host: %s\n", host) + fmt.Printf("HTTP Path: %s\n", httpPath) + fmt.Println() + + // Create U2M authenticator + authenticator, err := u2m.NewAuthenticator(host, 2*time.Minute) + if err != nil { + log.Fatal(err) + } + + // Create connector with native OAuth + connector, err := dbsql.NewConnector( + dbsql.WithServerHostname(host), + dbsql.WithHTTPPath(httpPath), + dbsql.WithAuthenticator(authenticator), + ) + if err != nil { + log.Fatal(err) + } + + db := sql.OpenDB(connector) + defer db.Close() + + // Test connection + fmt.Println("Testing connection with browser OAuth...") + + // First try ping to see if we can establish connection + fmt.Println("Attempting to ping database...") + if err := db.Ping(); err != nil { + log.Fatalf("Ping failed: %v", err) + } + fmt.Println("✓ Ping successful") + + if err := testConnection(db); err != nil { + log.Fatalf("Connection test failed: %v", err) + } + + fmt.Println() + fmt.Println("✓ Native U2M OAuth test PASSED") +} + +// testU2MWithFederation tests U2M OAuth with token federation (Account-wide WIF) +func testU2MWithFederation() { + fmt.Println("Test: U2M OAuth with Token Federation (Account-wide WIF)") + fmt.Println("---------------------------------------------------------") + fmt.Println("This tests Auth_Flow=2: Browser OAuth token → Federation exchange → Databricks token") + fmt.Println() + + host := os.Getenv("DATABRICKS_HOST") + httpPath := os.Getenv("DATABRICKS_HTTPPATH") + externalIdpHost := os.Getenv("EXTERNAL_IDP_HOST") + + if host == "" || httpPath == "" { + log.Fatal("DATABRICKS_HOST and DATABRICKS_HTTPPATH must be set") + } + + if externalIdpHost == "" { + fmt.Println("WARNING: EXTERNAL_IDP_HOST not set, using Databricks host") + externalIdpHost = host + } + + fmt.Printf("Databricks Host: %s\n", host) + fmt.Printf("HTTP Path: %s\n", httpPath) + fmt.Printf("External IdP Host: %s\n", externalIdpHost) + fmt.Println() + + // Step 1: Get token from external IdP using browser OAuth + fmt.Println("Step 1: Getting token from external IdP via browser OAuth...") + baseAuthenticator, err := u2m.NewAuthenticator(externalIdpHost, 2*time.Minute) + if err != nil { + log.Fatalf("Failed to create U2M authenticator: %v", err) + } + + // Wrap U2M authenticator as a token provider + u2mProvider := &U2MTokenProvider{authenticator: baseAuthenticator} + + // Step 2: Wrap with federation provider for automatic token exchange + fmt.Println("Step 2: Setting up federation provider for automatic token exchange...") + federationProvider := tokenprovider.NewFederationProvider(u2mProvider, host) + cachedProvider := tokenprovider.NewCachedTokenProvider(federationProvider) + + // Create connector with federated authentication + connector, err := dbsql.NewConnector( + dbsql.WithServerHostname(host), + dbsql.WithHTTPPath(httpPath), + dbsql.WithTokenProvider(cachedProvider), + ) + if err != nil { + log.Fatal(err) + } + + db := sql.OpenDB(connector) + defer db.Close() + + // Test connection + fmt.Println() + fmt.Println("Step 3: Testing connection (will trigger browser OAuth and token exchange)...") + if err := testConnection(db); err != nil { + log.Fatalf("Connection test failed: %v", err) + } + + fmt.Println() + fmt.Println("✓ U2M with Token Federation test PASSED") + fmt.Println() + fmt.Println("Token flow: Browser OAuth → External IdP Token → Token Exchange → Databricks Token") +} + +// testTokenPassthrough tests manual token passthrough with federation +func testTokenPassthrough() { + fmt.Println("Test: Token Passthrough with Federation (Auth_Flow=0)") + fmt.Println("------------------------------------------------------") + fmt.Println("This tests passing an external token that gets exchanged automatically") + fmt.Println() + + host := os.Getenv("DATABRICKS_HOST") + httpPath := os.Getenv("DATABRICKS_HTTPPATH") + externalToken := os.Getenv("EXTERNAL_TOKEN") + + if host == "" || httpPath == "" { + log.Fatal("DATABRICKS_HOST and DATABRICKS_HTTPPATH must be set") + } + + if externalToken == "" { + log.Fatal("EXTERNAL_TOKEN must be set (get from external IdP)") + } + + fmt.Printf("Host: %s\n", host) + fmt.Printf("Token issuer: %s\n", getTokenIssuer(externalToken)) + fmt.Println() + + // Create static token provider + baseProvider := tokenprovider.NewStaticTokenProvider(externalToken) + + // Wrap with federation provider + federationProvider := tokenprovider.NewFederationProvider(baseProvider, host) + cachedProvider := tokenprovider.NewCachedTokenProvider(federationProvider) + + connector, err := dbsql.NewConnector( + dbsql.WithServerHostname(host), + dbsql.WithHTTPPath(httpPath), + dbsql.WithTokenProvider(cachedProvider), + ) + if err != nil { + log.Fatal(err) + } + + db := sql.OpenDB(connector) + defer db.Close() + + fmt.Println("Testing connection with token passthrough...") + if err := testConnection(db); err != nil { + log.Fatalf("Connection test failed: %v", err) + } + + fmt.Println() + fmt.Println("✓ Token Passthrough with Federation test PASSED") +} + +// testExternalTokenWithFederation tests manual token exchange process +func testExternalTokenWithFederation() { + fmt.Println("Test: Manual Token Exchange (for debugging)") + fmt.Println("-------------------------------------------") + fmt.Println() + + host := os.Getenv("DATABRICKS_HOST") + httpPath := os.Getenv("DATABRICKS_HTTPPATH") + externalToken := os.Getenv("EXTERNAL_TOKEN") + + if host == "" || httpPath == "" || externalToken == "" { + log.Fatal("DATABRICKS_HOST, DATABRICKS_HTTPPATH, and EXTERNAL_TOKEN must be set") + } + + fmt.Printf("Host: %s\n", host) + fmt.Printf("Token issuer: %s\n", getTokenIssuer(externalToken)) + fmt.Println() + + // Manual token exchange + fmt.Println("Step 1: Manually exchanging token...") + exchangedToken, err := manualTokenExchange(host, externalToken) + if err != nil { + log.Fatalf("Token exchange failed: %v", err) + } + + fmt.Printf("✓ Token exchange successful\n") + fmt.Printf(" Exchanged token length: %d chars\n", len(exchangedToken)) + fmt.Println() + + // Test connection with exchanged token + fmt.Println("Step 2: Testing connection with exchanged token...") + provider := tokenprovider.NewStaticTokenProvider(exchangedToken) + cachedProvider := tokenprovider.NewCachedTokenProvider(provider) + + connector, err := dbsql.NewConnector( + dbsql.WithServerHostname(host), + dbsql.WithHTTPPath(httpPath), + dbsql.WithTokenProvider(cachedProvider), + ) + if err != nil { + log.Fatal(err) + } + + db := sql.OpenDB(connector) + defer db.Close() + + if err := testConnection(db); err != nil { + log.Fatalf("Connection test failed: %v", err) + } + + fmt.Println() + fmt.Println("✓ Manual Token Exchange test PASSED") +} + +// Helper: Test database connection with queries +func testConnection(db *sql.DB) error { + ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) + defer cancel() + + // Test 1: Simple query + var result int + err := db.QueryRowContext(ctx, "SELECT 1").Scan(&result) + if err != nil { + return fmt.Errorf("simple query failed: %w", err) + } + fmt.Printf("✓ SELECT 1 returned: %d\n", result) + + // Test 2: Range query + rows, err := db.QueryContext(ctx, "SELECT * FROM RANGE(5)") + if err != nil { + return fmt.Errorf("range query failed: %w", err) + } + defer rows.Close() + + count := 0 + for rows.Next() { + var id int64 + if err := rows.Scan(&id); err != nil { + return fmt.Errorf("scan failed: %w", err) + } + count++ + } + fmt.Printf("✓ SELECT FROM RANGE(5) returned %d rows\n", count) + + // Test 3: Current user query + var username string + err = db.QueryRowContext(ctx, "SELECT CURRENT_USER()").Scan(&username) + if err != nil { + return fmt.Errorf("current user query failed: %w", err) + } + fmt.Printf("✓ Connected as user: %s\n", username) + + return nil +} + +// Helper: Manual token exchange (for debugging/testing) +func manualTokenExchange(databricksHost, subjectToken string) (string, error) { + exchangeURL := databricksHost + if !strings.HasPrefix(exchangeURL, "http://") && !strings.HasPrefix(exchangeURL, "https://") { + exchangeURL = "https://" + exchangeURL + } + if !strings.HasSuffix(exchangeURL, "/") { + exchangeURL += "/" + } + exchangeURL += "oidc/v1/token" + + data := url.Values{} + data.Set("grant_type", "urn:ietf:params:oauth:grant-type:token-exchange") + data.Set("scope", "sql") + data.Set("subject_token_type", "urn:ietf:params:oauth:token-type:jwt") + data.Set("subject_token", subjectToken) + + req, err := http.NewRequest("POST", exchangeURL, strings.NewReader(data.Encode())) + if err != nil { + return "", err + } + + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + req.Header.Set("Accept", "*/*") + + client := &http.Client{Timeout: 30 * time.Second} + resp, err := client.Do(req) + if err != nil { + return "", err + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + return "", err + } + + if resp.StatusCode != http.StatusOK { + return "", fmt.Errorf("exchange failed with status %d: %s", resp.StatusCode, string(body)) + } + + var tokenResp struct { + AccessToken string `json:"access_token"` + TokenType string `json:"token_type"` + ExpiresIn int `json:"expires_in"` + Scope string `json:"scope"` + } + + if err := json.Unmarshal(body, &tokenResp); err != nil { + return "", err + } + + return tokenResp.AccessToken, nil +} + +// Helper: Get token issuer from JWT (for logging) +func getTokenIssuer(tokenString string) string { + parts := strings.Split(tokenString, ".") + if len(parts) < 2 { + return "not a JWT" + } + + // Decode payload (second part) + payload, err := decodeBase64(parts[1]) + if err != nil { + return "invalid JWT" + } + + var claims map[string]interface{} + if err := json.Unmarshal(payload, &claims); err != nil { + return "invalid JWT" + } + + if iss, ok := claims["iss"].(string); ok { + return iss + } + + return "unknown" +} + +func decodeBase64(s string) ([]byte, error) { + // Add padding if needed + switch len(s) % 4 { + case 2: + s += "==" + case 3: + s += "=" + } + return io.ReadAll(strings.NewReader(s)) +} + +// U2MTokenProvider wraps U2M authenticator as a TokenProvider +type U2MTokenProvider struct { + authenticator interface { + Authenticate(*http.Request) error + } +} + +func (p *U2MTokenProvider) GetToken(ctx context.Context) (*tokenprovider.Token, error) { + // Create a dummy request to trigger authentication + req, err := http.NewRequestWithContext(ctx, "GET", "http://dummy", nil) + if err != nil { + return nil, err + } + + // Authenticate will add Authorization header + if err := p.authenticator.Authenticate(req); err != nil { + return nil, err + } + + // Extract token from Authorization header + authHeader := req.Header.Get("Authorization") + if authHeader == "" { + return nil, fmt.Errorf("no authorization header set") + } + + // Parse "Bearer " + parts := strings.SplitN(authHeader, " ", 2) + if len(parts) != 2 { + return nil, fmt.Errorf("invalid authorization header format") + } + + return &tokenprovider.Token{ + AccessToken: parts[1], + TokenType: parts[0], + }, nil +} + +func (p *U2MTokenProvider) Name() string { + return "u2m-browser-oauth" +} diff --git a/examples/token_federation/main.go b/examples/token_federation/main.go new file mode 100644 index 00000000..30730196 --- /dev/null +++ b/examples/token_federation/main.go @@ -0,0 +1,344 @@ +package main + +import ( + "context" + "database/sql" + "encoding/json" + "fmt" + "io" + "log" + "net/http" + "os" + "strconv" + "time" + + dbsql "github.com/databricks/databricks-sql-go" + "github.com/databricks/databricks-sql-go/auth/tokenprovider" +) + +func main() { + // Get configuration from environment + host := os.Getenv("DATABRICKS_HOST") + httpPath := os.Getenv("DATABRICKS_HTTPPATH") + port, err := strconv.Atoi(os.Getenv("DATABRICKS_PORT")) + if err != nil { + port = 443 + } + + fmt.Println("Token Federation Examples") + fmt.Println("=========================") + + // Choose which example to run based on environment variable + example := os.Getenv("TOKEN_EXAMPLE") + if example == "" { + example = "static" + } + + switch example { + case "static": + runStaticTokenExample(host, httpPath, port) + case "external": + runExternalTokenExample(host, httpPath, port) + case "cached": + runCachedTokenExample(host, httpPath, port) + case "custom": + runCustomProviderExample(host, httpPath, port) + case "oauth": + runOAuthServiceExample(host, httpPath, port) + default: + log.Fatalf("Unknown example: %s", example) + } +} + +// Example 1: Static token (simplest case) +func runStaticTokenExample(host, httpPath string, port int) { + fmt.Println("\nExample 1: Static Token Provider") + fmt.Println("---------------------------------") + + token := os.Getenv("DATABRICKS_ACCESS_TOKEN") + if token == "" { + log.Fatal("DATABRICKS_ACCESS_TOKEN not set") + } + + connector, err := dbsql.NewConnector( + dbsql.WithServerHostname(host), + dbsql.WithPort(port), + dbsql.WithHTTPPath(httpPath), + dbsql.WithStaticToken(token), + ) + if err != nil { + log.Fatal(err) + } + + db := sql.OpenDB(connector) + defer db.Close() + + // Test the connection + var result int + err = db.QueryRow("SELECT 1").Scan(&result) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("✓ Connected successfully using static token\n") + fmt.Printf("✓ Test query result: %d\n", result) +} + +// Example 2: External token provider (token passthrough) +func runExternalTokenExample(host, httpPath string, port int) { + fmt.Println("\nExample 2: External Token Provider (Passthrough)") + fmt.Println("------------------------------------------------") + + // Simulate getting token from external source + tokenFunc := func() (string, error) { + // In real scenario, this could: + // - Read from a file + // - Call another service + // - Retrieve from a secret manager + // - Get from environment variable + token := os.Getenv("DATABRICKS_ACCESS_TOKEN") + if token == "" { + return "", fmt.Errorf("no token available") + } + fmt.Println(" → Fetching token from external source...") + return token, nil + } + + connector, err := dbsql.NewConnector( + dbsql.WithServerHostname(host), + dbsql.WithPort(port), + dbsql.WithHTTPPath(httpPath), + dbsql.WithExternalToken(tokenFunc), + ) + if err != nil { + log.Fatal(err) + } + + db := sql.OpenDB(connector) + defer db.Close() + + // Test the connection + var result int + err = db.QueryRow("SELECT 2").Scan(&result) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("✓ Connected successfully using external token provider\n") + fmt.Printf("✓ Test query result: %d\n", result) +} + +// Example 3: Cached token provider +func runCachedTokenExample(host, httpPath string, port int) { + fmt.Println("\nExample 3: Cached Token Provider") + fmt.Println("--------------------------------") + + callCount := 0 + // Create a token provider that tracks how many times it's called + baseProvider := tokenprovider.NewExternalTokenProvider(func() (string, error) { + callCount++ + fmt.Printf(" → Token provider called (count: %d)\n", callCount) + token := os.Getenv("DATABRICKS_ACCESS_TOKEN") + if token == "" { + return "", fmt.Errorf("no token available") + } + return token, nil + }) + + // Wrap with caching + cachedProvider := tokenprovider.NewCachedTokenProvider(baseProvider) + + connector, err := dbsql.NewConnector( + dbsql.WithServerHostname(host), + dbsql.WithPort(port), + dbsql.WithHTTPPath(httpPath), + dbsql.WithTokenProvider(cachedProvider), + ) + if err != nil { + log.Fatal(err) + } + + db := sql.OpenDB(connector) + defer db.Close() + + // Run multiple queries - token should only be fetched once due to caching + for i := 1; i <= 3; i++ { + var result int + err = db.QueryRow(fmt.Sprintf("SELECT %d", i)).Scan(&result) + if err != nil { + log.Fatal(err) + } + fmt.Printf("✓ Query %d result: %d\n", i, result) + } + + fmt.Printf("✓ Token was fetched %d time(s) (should be 1 due to caching)\n", callCount) +} + +// Example 4: Custom token provider with expiry +func runCustomProviderExample(host, httpPath string, port int) { + fmt.Println("\nExample 4: Custom Token Provider with Expiry") + fmt.Println("--------------------------------------------") + + // Custom provider that simulates token with expiry + provider := &CustomExpiringTokenProvider{ + baseToken: os.Getenv("DATABRICKS_ACCESS_TOKEN"), + expiry: 1 * time.Hour, + } + + // Wrap with caching to handle refresh + cachedProvider := tokenprovider.NewCachedTokenProvider(provider) + + connector, err := dbsql.NewConnector( + dbsql.WithServerHostname(host), + dbsql.WithPort(port), + dbsql.WithHTTPPath(httpPath), + dbsql.WithTokenProvider(cachedProvider), + ) + if err != nil { + log.Fatal(err) + } + + db := sql.OpenDB(connector) + defer db.Close() + + var result int + err = db.QueryRow("SELECT 42").Scan(&result) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("✓ Connected with custom provider\n") + fmt.Printf("✓ Token expires at: %s\n", provider.lastToken.ExpiresAt.Format(time.RFC3339)) + fmt.Printf("✓ Test query result: %d\n", result) +} + +// Example 5: OAuth service token provider +func runOAuthServiceExample(host, httpPath string, port int) { + fmt.Println("\nExample 5: OAuth Service Token Provider") + fmt.Println("---------------------------------------") + + oauthEndpoint := os.Getenv("OAUTH_TOKEN_ENDPOINT") + clientID := os.Getenv("OAUTH_CLIENT_ID") + clientSecret := os.Getenv("OAUTH_CLIENT_SECRET") + + if oauthEndpoint == "" || clientID == "" || clientSecret == "" { + fmt.Println("⚠ Skipping OAuth example (OAUTH_TOKEN_ENDPOINT, OAUTH_CLIENT_ID, or OAUTH_CLIENT_SECRET not set)") + return + } + + provider := &OAuthServiceTokenProvider{ + endpoint: oauthEndpoint, + clientID: clientID, + clientSecret: clientSecret, + } + + // Wrap with caching for efficiency + cachedProvider := tokenprovider.NewCachedTokenProvider(provider) + + connector, err := dbsql.NewConnector( + dbsql.WithServerHostname(host), + dbsql.WithPort(port), + dbsql.WithHTTPPath(httpPath), + dbsql.WithTokenProvider(cachedProvider), + ) + if err != nil { + log.Fatal(err) + } + + db := sql.OpenDB(connector) + defer db.Close() + + var result string + err = db.QueryRow("SELECT 'OAuth Success'").Scan(&result) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("✓ Connected with OAuth service token\n") + fmt.Printf("✓ Test query result: %s\n", result) +} + +// CustomExpiringTokenProvider simulates a provider with token expiry +type CustomExpiringTokenProvider struct { + baseToken string + expiry time.Duration + lastToken *tokenprovider.Token +} + +func (p *CustomExpiringTokenProvider) GetToken(ctx context.Context) (*tokenprovider.Token, error) { + if p.baseToken == "" { + return nil, fmt.Errorf("no base token configured") + } + + fmt.Println(" → Generating new token with expiry...") + p.lastToken = &tokenprovider.Token{ + AccessToken: p.baseToken, + TokenType: "Bearer", + ExpiresAt: time.Now().Add(p.expiry), + } + + return p.lastToken, nil +} + +func (p *CustomExpiringTokenProvider) Name() string { + return "custom-expiring" +} + +// OAuthServiceTokenProvider gets tokens from an OAuth service +type OAuthServiceTokenProvider struct { + endpoint string + clientID string + clientSecret string +} + +func (p *OAuthServiceTokenProvider) GetToken(ctx context.Context) (*tokenprovider.Token, error) { + fmt.Printf(" → Fetching token from OAuth service: %s\n", p.endpoint) + + // Create OAuth request + req, err := http.NewRequestWithContext(ctx, "POST", p.endpoint, nil) + if err != nil { + return nil, err + } + + req.SetBasicAuth(p.clientID, p.clientSecret) + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + // Make request + client := &http.Client{Timeout: 30 * time.Second} + resp, err := client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + body, _ := io.ReadAll(resp.Body) + return nil, fmt.Errorf("OAuth service returned %d: %s", resp.StatusCode, body) + } + + // Parse response + var tokenResp struct { + AccessToken string `json:"access_token"` + TokenType string `json:"token_type"` + ExpiresIn int `json:"expires_in"` + } + + if err := json.NewDecoder(resp.Body).Decode(&tokenResp); err != nil { + return nil, err + } + + token := &tokenprovider.Token{ + AccessToken: tokenResp.AccessToken, + TokenType: tokenResp.TokenType, + } + + if tokenResp.ExpiresIn > 0 { + token.ExpiresAt = time.Now().Add(time.Duration(tokenResp.ExpiresIn) * time.Second) + } + + return token, nil +} + +func (p *OAuthServiceTokenProvider) Name() string { + return "oauth-service" +} \ No newline at end of file diff --git a/go.mod b/go.mod index d9a517c5..cd2c4e56 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,14 @@ module github.com/databricks/databricks-sql-go -go 1.20 +go 1.21 + +toolchain go1.24.7 require ( github.com/apache/arrow/go/v12 v12.0.1 github.com/apache/thrift v0.17.0 github.com/coreos/go-oidc/v3 v3.5.0 + github.com/golang-jwt/jwt/v5 v5.3.0 github.com/joho/godotenv v1.4.0 github.com/mattn/go-isatty v0.0.20 github.com/pierrec/lz4/v4 v4.1.15 diff --git a/go.sum b/go.sum index edeb89ee..313f38cc 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,6 @@ cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU= +github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/apache/arrow/go/v12 v12.0.1 h1:JsR2+hzYYjgSUkBSaahpqCetqZMr76djX80fF/DiJbg= @@ -26,6 +27,8 @@ github.com/go-jose/go-jose/v3 v3.0.4/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQr github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= @@ -42,9 +45,11 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= @@ -57,6 +62,7 @@ github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBF github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -83,6 +89,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.28.0 h1:MirSo27VyNi7RJYP3078AA1+Cyzd2GB66qy3aUHvsWY= github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= @@ -100,6 +107,7 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= +github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -111,6 +119,7 @@ golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDf golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20220827204233-334a2380cb91 h1:tnebWN09GYg9OLPss1KXj8txwZc6X6uMr6VFdcGNbHw= +golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= @@ -195,6 +204,7 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= +gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -205,6 +215,7 @@ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From bf86224918179b2a3f31339f86f3d929ae73f36e Mon Sep 17 00:00:00 2001 From: Madhav Sainanee Date: Fri, 17 Oct 2025 11:28:35 +0000 Subject: [PATCH 2/8] remove unnecessary code --- auth/tokenprovider/exchange.go | 165 --------------------------------- 1 file changed, 165 deletions(-) diff --git a/auth/tokenprovider/exchange.go b/auth/tokenprovider/exchange.go index 5120fe42..6dd18f4a 100644 --- a/auth/tokenprovider/exchange.go +++ b/auth/tokenprovider/exchange.go @@ -204,169 +204,4 @@ func (p *FederationProvider) Name() string { return fmt.Sprintf("federation[%s,sp:%s]", baseName, p.clientID[:8]) // Truncate client ID for readability } return fmt.Sprintf("federation[%s]", baseName) -} - -// JWTProvider creates tokens from JWT credentials (for M2M flows) -type JWTProvider struct { - clientID string - privateKey interface{} - tokenURL string - scopes []string - audience string - keyID string - httpClient *http.Client - jwtExpiration time.Duration -} - -// NewJWTProvider creates a provider that uses JWT assertion for M2M authentication -func NewJWTProvider(clientID, tokenURL string, privateKey interface{}) *JWTProvider { - return &JWTProvider{ - clientID: clientID, - privateKey: privateKey, - tokenURL: tokenURL, - scopes: []string{"sql"}, - httpClient: &http.Client{Timeout: 30 * time.Second}, - jwtExpiration: 5 * time.Minute, - } -} - -// WithScopes sets the OAuth scopes -func (p *JWTProvider) WithScopes(scopes []string) *JWTProvider { - p.scopes = scopes - return p -} - -// WithAudience sets the JWT audience -func (p *JWTProvider) WithAudience(audience string) *JWTProvider { - p.audience = audience - return p -} - -// WithKeyID sets the JWT key ID -func (p *JWTProvider) WithKeyID(keyID string) *JWTProvider { - p.keyID = keyID - return p -} - -// GetToken creates a JWT assertion and exchanges it for an access token -func (p *JWTProvider) GetToken(ctx context.Context) (*Token, error) { - // Create JWT assertion - jwtToken, err := p.createJWTAssertion() - if err != nil { - return nil, fmt.Errorf("jwt provider: failed to create JWT assertion: %w", err) - } - - // Exchange JWT for access token - return p.exchangeJWTForToken(ctx, jwtToken) -} - -// createJWTAssertion creates a JWT assertion for client credentials flow -func (p *JWTProvider) createJWTAssertion() (string, error) { - now := time.Now() - claims := jwt.MapClaims{ - "iss": p.clientID, - "sub": p.clientID, - "aud": p.audience, - "iat": now.Unix(), - "exp": now.Add(p.jwtExpiration).Unix(), - } - - token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) - - if p.keyID != "" { - token.Header["kid"] = p.keyID - } - - return token.SignedString(p.privateKey) -} - -// exchangeJWTForToken exchanges JWT assertion for access token -func (p *JWTProvider) exchangeJWTForToken(ctx context.Context, jwtAssertion string) (*Token, error) { - data := url.Values{} - data.Set("grant_type", "client_credentials") - data.Set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer") - data.Set("client_assertion", jwtAssertion) - data.Set("scope", strings.Join(p.scopes, " ")) - - req, err := http.NewRequestWithContext(ctx, "POST", p.tokenURL, strings.NewReader(data.Encode())) - if err != nil { - return nil, fmt.Errorf("failed to create request: %w", err) - } - - req.Header.Set("Content-Type", "application/x-www-form-urlencoded") - - resp, err := p.httpClient.Do(req) - if err != nil { - return nil, fmt.Errorf("request failed: %w", err) - } - defer resp.Body.Close() - - body, err := io.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("failed to read response: %w", err) - } - - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("token request failed with status %d: %s", resp.StatusCode, string(body)) - } - - var tokenResp struct { - AccessToken string `json:"access_token"` - TokenType string `json:"token_type"` - ExpiresIn int `json:"expires_in"` - Scope string `json:"scope"` - } - - if err := json.Unmarshal(body, &tokenResp); err != nil { - return nil, fmt.Errorf("failed to parse response: %w", err) - } - - token := &Token{ - AccessToken: tokenResp.AccessToken, - TokenType: tokenResp.TokenType, - Scopes: strings.Fields(tokenResp.Scope), - } - - if tokenResp.ExpiresIn > 0 { - token.ExpiresAt = time.Now().Add(time.Duration(tokenResp.ExpiresIn) * time.Second) - } - - return token, nil -} - -// Name returns the provider name -func (p *JWTProvider) Name() string { - return "jwt-assertion" -} - -// ParsePrivateKeyFromPEM parses a private key from PEM format -func ParsePrivateKeyFromPEM(pemData []byte, passphrase string) (interface{}, error) { - block, _ := pem.Decode(pemData) - if block == nil { - return nil, fmt.Errorf("failed to decode PEM block") - } - - var keyBytes []byte - var err error - - if passphrase != "" && x509.IsEncryptedPEMBlock(block) { - keyBytes, err = x509.DecryptPEMBlock(block, []byte(passphrase)) - if err != nil { - return nil, fmt.Errorf("failed to decrypt PEM block: %w", err) - } - } else { - keyBytes = block.Bytes - } - - // Try parsing as PKCS1 RSA private key first - if key, err := x509.ParsePKCS1PrivateKey(keyBytes); err == nil { - return key, nil - } - - // Try parsing as PKCS8 private key - if key, err := x509.ParsePKCS8PrivateKey(keyBytes); err == nil { - return key, nil - } - - return nil, fmt.Errorf("unsupported private key format") } \ No newline at end of file From 3272ce391615e1e41f73507312da184653ffc121 Mon Sep 17 00:00:00 2001 From: Madhav Sainanee Date: Wed, 29 Oct 2025 10:52:47 +0000 Subject: [PATCH 3/8] lint fix --- go.mod | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.mod b/go.mod index cd2c4e56..3016791b 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module github.com/databricks/databricks-sql-go go 1.21 -toolchain go1.24.7 - require ( github.com/apache/arrow/go/v12 v12.0.1 github.com/apache/thrift v0.17.0 From bc312be2be6e09d3979e0d2f5b9b4a2eaf053dd0 Mon Sep 17 00:00:00 2001 From: Madhav Sainanee Date: Wed, 29 Oct 2025 10:53:41 +0000 Subject: [PATCH 4/8] lint fix --- auth/tokenprovider/exchange.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/auth/tokenprovider/exchange.go b/auth/tokenprovider/exchange.go index 6dd18f4a..7bd0e8e2 100644 --- a/auth/tokenprovider/exchange.go +++ b/auth/tokenprovider/exchange.go @@ -2,9 +2,7 @@ package tokenprovider import ( "context" - "crypto/x509" "encoding/json" - "encoding/pem" "fmt" "io" "net/http" From ad97cf9df709e9e0c0a7112ff484d5899753e625 Mon Sep 17 00:00:00 2001 From: Madhav Sainanee Date: Wed, 29 Oct 2025 10:54:28 +0000 Subject: [PATCH 5/8] remove irrelevant comment --- auth/tokenprovider/exchange.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/auth/tokenprovider/exchange.go b/auth/tokenprovider/exchange.go index 7bd0e8e2..8c0bba60 100644 --- a/auth/tokenprovider/exchange.go +++ b/auth/tokenprovider/exchange.go @@ -175,7 +175,6 @@ func (p *FederationProvider) tryTokenExchange(ctx context.Context, subjectToken } // isSameHost compares two URLs to see if they have the same host -// This matches Python's behavior: ignores port differences (e.g., :443 vs no port for HTTPS) func (p *FederationProvider) isSameHost(url1, url2 string) bool { // Add scheme to url2 if it doesn't have one (databricksHost may not have scheme) parsedURL2 := url2 @@ -202,4 +201,4 @@ func (p *FederationProvider) Name() string { return fmt.Sprintf("federation[%s,sp:%s]", baseName, p.clientID[:8]) // Truncate client ID for readability } return fmt.Sprintf("federation[%s]", baseName) -} \ No newline at end of file +} From 7b927c3386584519ce43ef4beda8bd04cc092c02 Mon Sep 17 00:00:00 2001 From: Madhav Sainanee Date: Wed, 29 Oct 2025 11:09:49 +0000 Subject: [PATCH 6/8] versioning --- go.mod | 4 ++-- go.sum | 13 ++----------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 3016791b..1d1fdc78 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,12 @@ module github.com/databricks/databricks-sql-go -go 1.21 +go 1.20 require ( github.com/apache/arrow/go/v12 v12.0.1 github.com/apache/thrift v0.17.0 github.com/coreos/go-oidc/v3 v3.5.0 - github.com/golang-jwt/jwt/v5 v5.3.0 + github.com/golang-jwt/jwt/v5 v5.2.1 github.com/joho/godotenv v1.4.0 github.com/mattn/go-isatty v0.0.20 github.com/pierrec/lz4/v4 v4.1.15 diff --git a/go.sum b/go.sum index 313f38cc..670487a8 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,5 @@ cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU= -github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/apache/arrow/go/v12 v12.0.1 h1:JsR2+hzYYjgSUkBSaahpqCetqZMr76djX80fF/DiJbg= @@ -27,8 +26,8 @@ github.com/go-jose/go-jose/v3 v3.0.4/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQr github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= -github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= @@ -45,11 +44,9 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= -github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= @@ -62,7 +59,6 @@ github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBF github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -89,7 +85,6 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.28.0 h1:MirSo27VyNi7RJYP3078AA1+Cyzd2GB66qy3aUHvsWY= github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= @@ -107,7 +102,6 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= -github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -119,7 +113,6 @@ golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDf golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20220827204233-334a2380cb91 h1:tnebWN09GYg9OLPss1KXj8txwZc6X6uMr6VFdcGNbHw= -golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= @@ -204,7 +197,6 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= -gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= @@ -215,7 +207,6 @@ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From ac21de326e88f49278ffbf7de0d0b69446982416 Mon Sep 17 00:00:00 2001 From: Madhav Sainanee Date: Wed, 29 Oct 2025 11:14:40 +0000 Subject: [PATCH 7/8] lint --- auth/tokenprovider/authenticator.go | 2 +- auth/tokenprovider/authenticator_test.go | 2 +- auth/tokenprovider/cached.go | 2 +- auth/tokenprovider/external.go | 2 +- auth/tokenprovider/federation_test.go | 20 +- auth/tokenprovider/provider.go | 2 +- auth/tokenprovider/provider_test.go | 2 +- auth/tokenprovider/static.go | 2 +- examples/token_federation/main.go | 2 +- internal/cli_service/GoUnusedProtection__.go | 3 +- internal/cli_service/cli_service-consts.go | 65 +- internal/cli_service/cli_service.go | 50286 +++++++++-------- 12 files changed, 27021 insertions(+), 23369 deletions(-) diff --git a/auth/tokenprovider/authenticator.go b/auth/tokenprovider/authenticator.go index 42b574c0..3955a4c9 100644 --- a/auth/tokenprovider/authenticator.go +++ b/auth/tokenprovider/authenticator.go @@ -41,4 +41,4 @@ func (a *TokenProviderAuthenticator) Authenticate(r *http.Request) error { log.Debug().Msgf("token provider authenticator: authenticated using provider %s", a.provider.Name()) return nil -} \ No newline at end of file +} diff --git a/auth/tokenprovider/authenticator_test.go b/auth/tokenprovider/authenticator_test.go index c5a43392..a47dd6bc 100644 --- a/auth/tokenprovider/authenticator_test.go +++ b/auth/tokenprovider/authenticator_test.go @@ -132,4 +132,4 @@ func TestTokenProviderAuthenticator(t *testing.T) { // Should only call base provider once due to caching assert.Equal(t, 1, callCount) }) -} \ No newline at end of file +} diff --git a/auth/tokenprovider/cached.go b/auth/tokenprovider/cached.go index 585a1ea1..b59e883e 100644 --- a/auth/tokenprovider/cached.go +++ b/auth/tokenprovider/cached.go @@ -83,4 +83,4 @@ func (p *CachedTokenProvider) ClearCache() { p.mutex.Lock() p.cache = nil p.mutex.Unlock() -} \ No newline at end of file +} diff --git a/auth/tokenprovider/external.go b/auth/tokenprovider/external.go index 3cf6570f..0e511234 100644 --- a/auth/tokenprovider/external.go +++ b/auth/tokenprovider/external.go @@ -53,4 +53,4 @@ func (p *ExternalTokenProvider) GetToken(ctx context.Context) (*Token, error) { // Name returns the provider name func (p *ExternalTokenProvider) Name() string { return "external" -} \ No newline at end of file +} diff --git a/auth/tokenprovider/federation_test.go b/auth/tokenprovider/federation_test.go index 3db1aea6..554b7333 100644 --- a/auth/tokenprovider/federation_test.go +++ b/auth/tokenprovider/federation_test.go @@ -127,7 +127,7 @@ func TestFederationProvider_TokenExchangeSuccess(t *testing.T) { "scope": "sql", } w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(response) + _ = json.NewEncoder(w).Encode(response) })) defer server.Close() @@ -167,7 +167,7 @@ func TestFederationProvider_TokenExchangeWithClientID(t *testing.T) { "expires_in": 3600, } w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(response) + _ = json.NewEncoder(w).Encode(response) })) defer server.Close() @@ -187,7 +187,7 @@ func TestFederationProvider_TokenExchangeFailureFallback(t *testing.T) { // Create mock server that returns error server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusBadRequest) - w.Write([]byte(`{"error": "invalid_request"}`)) + _, _ = w.Write([]byte(`{"error": "invalid_request"}`)) })) defer server.Close() @@ -264,7 +264,7 @@ func TestFederationProvider_CachedIntegration(t *testing.T) { "expires_in": 3600, } w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(response) + _ = json.NewEncoder(w).Encode(response) })) defer server.Close() @@ -325,12 +325,12 @@ func TestFederationProvider_InvalidJWT(t *testing.T) { func TestFederationProvider_RealWorldIssuers(t *testing.T) { // Test with real-world identity provider issuers issuers := map[string]string{ - "azure_ad": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", - "google": "https://accounts.google.com", - "aws_cognito": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_example", - "okta": "https://dev-12345.okta.com/oauth2/default", - "auth0": "https://dev-12345.auth0.com/", - "github": "https://token.actions.githubusercontent.com", + "azure_ad": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0", + "google": "https://accounts.google.com", + "aws_cognito": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_example", + "okta": "https://dev-12345.okta.com/oauth2/default", + "auth0": "https://dev-12345.auth0.com/", + "github": "https://token.actions.githubusercontent.com", } databricksHost := "test.databricks.com" diff --git a/auth/tokenprovider/provider.go b/auth/tokenprovider/provider.go index 911b0bc5..3e94d6ef 100644 --- a/auth/tokenprovider/provider.go +++ b/auth/tokenprovider/provider.go @@ -40,4 +40,4 @@ func (t *Token) SetAuthHeader(r *http.Request) { tokenType = "Bearer" } r.Header.Set("Authorization", tokenType+" "+t.AccessToken) -} \ No newline at end of file +} diff --git a/auth/tokenprovider/provider_test.go b/auth/tokenprovider/provider_test.go index 0fd59034..5acb5538 100644 --- a/auth/tokenprovider/provider_test.go +++ b/auth/tokenprovider/provider_test.go @@ -420,4 +420,4 @@ func (m *mockProvider) GetToken(ctx context.Context) (*Token, error) { func (m *mockProvider) Name() string { return m.name -} \ No newline at end of file +} diff --git a/auth/tokenprovider/static.go b/auth/tokenprovider/static.go index 0ff265e4..46079ba0 100644 --- a/auth/tokenprovider/static.go +++ b/auth/tokenprovider/static.go @@ -44,4 +44,4 @@ func (p *StaticTokenProvider) GetToken(ctx context.Context) (*Token, error) { // Name returns the provider name func (p *StaticTokenProvider) Name() string { return "static" -} \ No newline at end of file +} diff --git a/examples/token_federation/main.go b/examples/token_federation/main.go index 30730196..e2deeaff 100644 --- a/examples/token_federation/main.go +++ b/examples/token_federation/main.go @@ -341,4 +341,4 @@ func (p *OAuthServiceTokenProvider) GetToken(ctx context.Context) (*tokenprovide func (p *OAuthServiceTokenProvider) Name() string { return "oauth-service" -} \ No newline at end of file +} diff --git a/internal/cli_service/GoUnusedProtection__.go b/internal/cli_service/GoUnusedProtection__.go index 130d291d..3e573a70 100644 --- a/internal/cli_service/GoUnusedProtection__.go +++ b/internal/cli_service/GoUnusedProtection__.go @@ -2,5 +2,4 @@ package cli_service -var GoUnusedProtection__ int; - +var GoUnusedProtection__ int diff --git a/internal/cli_service/cli_service-consts.go b/internal/cli_service/cli_service-consts.go index 1048c269..2ad6a148 100644 --- a/internal/cli_service/cli_service-consts.go +++ b/internal/cli_service/cli_service-consts.go @@ -7,10 +7,10 @@ import ( "context" "errors" "fmt" - "time" thrift "github.com/apache/thrift/lib/go/thrift" - "strings" "regexp" + "strings" + "time" ) // (needed to ensure safety because of naive import list construction.) @@ -20,6 +20,7 @@ var _ = errors.New var _ = context.Background var _ = time.Now var _ = bytes.Equal + // (needed by validator.) var _ = strings.Contains var _ = regexp.MatchString @@ -28,43 +29,43 @@ var PRIMITIVE_TYPES []TTypeId var COMPLEX_TYPES []TTypeId var COLLECTION_TYPES []TTypeId var TYPE_NAMES map[TTypeId]string + const CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength" const PRECISION = "precision" const SCALE = "scale" func init() { -PRIMITIVE_TYPES = []TTypeId{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 21, } + PRIMITIVE_TYPES = []TTypeId{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 21} -COMPLEX_TYPES = []TTypeId{ - 10, 11, 12, 13, 14, } + COMPLEX_TYPES = []TTypeId{ + 10, 11, 12, 13, 14} -COLLECTION_TYPES = []TTypeId{ - 10, 11, } + COLLECTION_TYPES = []TTypeId{ + 10, 11} -TYPE_NAMES = map[TTypeId]string{ - 10: "ARRAY", - 4: "BIGINT", - 9: "BINARY", - 0: "BOOLEAN", - 19: "CHAR", - 17: "DATE", - 15: "DECIMAL", - 6: "DOUBLE", - 5: "FLOAT", - 21: "INTERVAL_DAY_TIME", - 20: "INTERVAL_YEAR_MONTH", - 3: "INT", - 11: "MAP", - 16: "NULL", - 2: "SMALLINT", - 7: "STRING", - 12: "STRUCT", - 8: "TIMESTAMP", - 1: "TINYINT", - 13: "UNIONTYPE", - 18: "VARCHAR", -} + TYPE_NAMES = map[TTypeId]string{ + 10: "ARRAY", + 4: "BIGINT", + 9: "BINARY", + 0: "BOOLEAN", + 19: "CHAR", + 17: "DATE", + 15: "DECIMAL", + 6: "DOUBLE", + 5: "FLOAT", + 21: "INTERVAL_DAY_TIME", + 20: "INTERVAL_YEAR_MONTH", + 3: "INT", + 11: "MAP", + 16: "NULL", + 2: "SMALLINT", + 7: "STRING", + 12: "STRUCT", + 8: "TIMESTAMP", + 1: "TINYINT", + 13: "UNIONTYPE", + 18: "VARCHAR", + } } - diff --git a/internal/cli_service/cli_service.go b/internal/cli_service/cli_service.go index 71952c69..c4eee3a4 100644 --- a/internal/cli_service/cli_service.go +++ b/internal/cli_service/cli_service.go @@ -8,10 +8,10 @@ import ( "database/sql/driver" "errors" "fmt" - "time" thrift "github.com/apache/thrift/lib/go/thrift" - "strings" "regexp" + "strings" + "time" ) // (needed to ensure safety because of naive import list construction.) @@ -21,979 +21,1262 @@ var _ = errors.New var _ = context.Background var _ = time.Now var _ = bytes.Equal + // (needed by validator.) var _ = strings.Contains var _ = regexp.MatchString type TProtocolVersion int64 + const ( - TProtocolVersion___HIVE_JDBC_WORKAROUND TProtocolVersion = -7 - TProtocolVersion___TEST_PROTOCOL_VERSION TProtocolVersion = 65281 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1 TProtocolVersion = 0 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2 TProtocolVersion = 1 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3 TProtocolVersion = 2 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4 TProtocolVersion = 3 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5 TProtocolVersion = 4 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6 TProtocolVersion = 5 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7 TProtocolVersion = 6 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8 TProtocolVersion = 7 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9 TProtocolVersion = 8 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10 TProtocolVersion = 9 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V1 TProtocolVersion = 42241 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V2 TProtocolVersion = 42242 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V3 TProtocolVersion = 42243 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V4 TProtocolVersion = 42244 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V5 TProtocolVersion = 42245 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6 TProtocolVersion = 42246 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V7 TProtocolVersion = 42247 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V8 TProtocolVersion = 42248 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V9 TProtocolVersion = 42249 + TProtocolVersion___HIVE_JDBC_WORKAROUND TProtocolVersion = -7 + TProtocolVersion___TEST_PROTOCOL_VERSION TProtocolVersion = 65281 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1 TProtocolVersion = 0 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2 TProtocolVersion = 1 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3 TProtocolVersion = 2 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4 TProtocolVersion = 3 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5 TProtocolVersion = 4 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6 TProtocolVersion = 5 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7 TProtocolVersion = 6 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8 TProtocolVersion = 7 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9 TProtocolVersion = 8 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10 TProtocolVersion = 9 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V1 TProtocolVersion = 42241 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V2 TProtocolVersion = 42242 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V3 TProtocolVersion = 42243 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V4 TProtocolVersion = 42244 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V5 TProtocolVersion = 42245 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6 TProtocolVersion = 42246 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V7 TProtocolVersion = 42247 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V8 TProtocolVersion = 42248 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V9 TProtocolVersion = 42249 ) func (p TProtocolVersion) String() string { - switch p { - case TProtocolVersion___HIVE_JDBC_WORKAROUND: return "__HIVE_JDBC_WORKAROUND" - case TProtocolVersion___TEST_PROTOCOL_VERSION: return "__TEST_PROTOCOL_VERSION" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1: return "HIVE_CLI_SERVICE_PROTOCOL_V1" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2: return "HIVE_CLI_SERVICE_PROTOCOL_V2" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3: return "HIVE_CLI_SERVICE_PROTOCOL_V3" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4: return "HIVE_CLI_SERVICE_PROTOCOL_V4" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5: return "HIVE_CLI_SERVICE_PROTOCOL_V5" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6: return "HIVE_CLI_SERVICE_PROTOCOL_V6" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7: return "HIVE_CLI_SERVICE_PROTOCOL_V7" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8: return "HIVE_CLI_SERVICE_PROTOCOL_V8" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9: return "HIVE_CLI_SERVICE_PROTOCOL_V9" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10: return "HIVE_CLI_SERVICE_PROTOCOL_V10" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V1: return "SPARK_CLI_SERVICE_PROTOCOL_V1" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V2: return "SPARK_CLI_SERVICE_PROTOCOL_V2" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V3: return "SPARK_CLI_SERVICE_PROTOCOL_V3" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V4: return "SPARK_CLI_SERVICE_PROTOCOL_V4" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V5: return "SPARK_CLI_SERVICE_PROTOCOL_V5" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6: return "SPARK_CLI_SERVICE_PROTOCOL_V6" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V7: return "SPARK_CLI_SERVICE_PROTOCOL_V7" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V8: return "SPARK_CLI_SERVICE_PROTOCOL_V8" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V9: return "SPARK_CLI_SERVICE_PROTOCOL_V9" - } - return "" + switch p { + case TProtocolVersion___HIVE_JDBC_WORKAROUND: + return "__HIVE_JDBC_WORKAROUND" + case TProtocolVersion___TEST_PROTOCOL_VERSION: + return "__TEST_PROTOCOL_VERSION" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1: + return "HIVE_CLI_SERVICE_PROTOCOL_V1" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2: + return "HIVE_CLI_SERVICE_PROTOCOL_V2" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3: + return "HIVE_CLI_SERVICE_PROTOCOL_V3" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4: + return "HIVE_CLI_SERVICE_PROTOCOL_V4" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5: + return "HIVE_CLI_SERVICE_PROTOCOL_V5" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6: + return "HIVE_CLI_SERVICE_PROTOCOL_V6" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7: + return "HIVE_CLI_SERVICE_PROTOCOL_V7" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8: + return "HIVE_CLI_SERVICE_PROTOCOL_V8" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9: + return "HIVE_CLI_SERVICE_PROTOCOL_V9" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10: + return "HIVE_CLI_SERVICE_PROTOCOL_V10" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V1: + return "SPARK_CLI_SERVICE_PROTOCOL_V1" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V2: + return "SPARK_CLI_SERVICE_PROTOCOL_V2" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V3: + return "SPARK_CLI_SERVICE_PROTOCOL_V3" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V4: + return "SPARK_CLI_SERVICE_PROTOCOL_V4" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V5: + return "SPARK_CLI_SERVICE_PROTOCOL_V5" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6: + return "SPARK_CLI_SERVICE_PROTOCOL_V6" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V7: + return "SPARK_CLI_SERVICE_PROTOCOL_V7" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V8: + return "SPARK_CLI_SERVICE_PROTOCOL_V8" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V9: + return "SPARK_CLI_SERVICE_PROTOCOL_V9" + } + return "" } func TProtocolVersionFromString(s string) (TProtocolVersion, error) { - switch s { - case "__HIVE_JDBC_WORKAROUND": return TProtocolVersion___HIVE_JDBC_WORKAROUND, nil - case "__TEST_PROTOCOL_VERSION": return TProtocolVersion___TEST_PROTOCOL_VERSION, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V1": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V2": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V3": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V4": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V5": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V6": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V7": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V8": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V9": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V10": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V1": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V1, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V2": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V2, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V3": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V3, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V4": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V4, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V5": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V5, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V6": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V7": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V7, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V8": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V8, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V9": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V9, nil - } - return TProtocolVersion(0), fmt.Errorf("not a valid TProtocolVersion string") + switch s { + case "__HIVE_JDBC_WORKAROUND": + return TProtocolVersion___HIVE_JDBC_WORKAROUND, nil + case "__TEST_PROTOCOL_VERSION": + return TProtocolVersion___TEST_PROTOCOL_VERSION, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V1": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V2": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V3": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V4": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V5": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V6": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V7": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V8": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V9": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V10": + return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V1": + return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V1, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V2": + return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V2, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V3": + return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V3, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V4": + return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V4, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V5": + return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V5, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V6": + return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V7": + return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V7, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V8": + return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V8, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V9": + return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V9, nil + } + return TProtocolVersion(0), fmt.Errorf("not a valid TProtocolVersion string") } - func TProtocolVersionPtr(v TProtocolVersion) *TProtocolVersion { return &v } func (p TProtocolVersion) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TProtocolVersion) UnmarshalText(text []byte) error { -q, err := TProtocolVersionFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TProtocolVersionFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TProtocolVersion) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TProtocolVersion(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TProtocolVersion(v) + return nil } -func (p * TProtocolVersion) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TProtocolVersion) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TTypeId int64 + const ( - TTypeId_BOOLEAN_TYPE TTypeId = 0 - TTypeId_TINYINT_TYPE TTypeId = 1 - TTypeId_SMALLINT_TYPE TTypeId = 2 - TTypeId_INT_TYPE TTypeId = 3 - TTypeId_BIGINT_TYPE TTypeId = 4 - TTypeId_FLOAT_TYPE TTypeId = 5 - TTypeId_DOUBLE_TYPE TTypeId = 6 - TTypeId_STRING_TYPE TTypeId = 7 - TTypeId_TIMESTAMP_TYPE TTypeId = 8 - TTypeId_BINARY_TYPE TTypeId = 9 - TTypeId_ARRAY_TYPE TTypeId = 10 - TTypeId_MAP_TYPE TTypeId = 11 - TTypeId_STRUCT_TYPE TTypeId = 12 - TTypeId_UNION_TYPE TTypeId = 13 - TTypeId_USER_DEFINED_TYPE TTypeId = 14 - TTypeId_DECIMAL_TYPE TTypeId = 15 - TTypeId_NULL_TYPE TTypeId = 16 - TTypeId_DATE_TYPE TTypeId = 17 - TTypeId_VARCHAR_TYPE TTypeId = 18 - TTypeId_CHAR_TYPE TTypeId = 19 - TTypeId_INTERVAL_YEAR_MONTH_TYPE TTypeId = 20 - TTypeId_INTERVAL_DAY_TIME_TYPE TTypeId = 21 + TTypeId_BOOLEAN_TYPE TTypeId = 0 + TTypeId_TINYINT_TYPE TTypeId = 1 + TTypeId_SMALLINT_TYPE TTypeId = 2 + TTypeId_INT_TYPE TTypeId = 3 + TTypeId_BIGINT_TYPE TTypeId = 4 + TTypeId_FLOAT_TYPE TTypeId = 5 + TTypeId_DOUBLE_TYPE TTypeId = 6 + TTypeId_STRING_TYPE TTypeId = 7 + TTypeId_TIMESTAMP_TYPE TTypeId = 8 + TTypeId_BINARY_TYPE TTypeId = 9 + TTypeId_ARRAY_TYPE TTypeId = 10 + TTypeId_MAP_TYPE TTypeId = 11 + TTypeId_STRUCT_TYPE TTypeId = 12 + TTypeId_UNION_TYPE TTypeId = 13 + TTypeId_USER_DEFINED_TYPE TTypeId = 14 + TTypeId_DECIMAL_TYPE TTypeId = 15 + TTypeId_NULL_TYPE TTypeId = 16 + TTypeId_DATE_TYPE TTypeId = 17 + TTypeId_VARCHAR_TYPE TTypeId = 18 + TTypeId_CHAR_TYPE TTypeId = 19 + TTypeId_INTERVAL_YEAR_MONTH_TYPE TTypeId = 20 + TTypeId_INTERVAL_DAY_TIME_TYPE TTypeId = 21 ) func (p TTypeId) String() string { - switch p { - case TTypeId_BOOLEAN_TYPE: return "BOOLEAN_TYPE" - case TTypeId_TINYINT_TYPE: return "TINYINT_TYPE" - case TTypeId_SMALLINT_TYPE: return "SMALLINT_TYPE" - case TTypeId_INT_TYPE: return "INT_TYPE" - case TTypeId_BIGINT_TYPE: return "BIGINT_TYPE" - case TTypeId_FLOAT_TYPE: return "FLOAT_TYPE" - case TTypeId_DOUBLE_TYPE: return "DOUBLE_TYPE" - case TTypeId_STRING_TYPE: return "STRING_TYPE" - case TTypeId_TIMESTAMP_TYPE: return "TIMESTAMP_TYPE" - case TTypeId_BINARY_TYPE: return "BINARY_TYPE" - case TTypeId_ARRAY_TYPE: return "ARRAY_TYPE" - case TTypeId_MAP_TYPE: return "MAP_TYPE" - case TTypeId_STRUCT_TYPE: return "STRUCT_TYPE" - case TTypeId_UNION_TYPE: return "UNION_TYPE" - case TTypeId_USER_DEFINED_TYPE: return "USER_DEFINED_TYPE" - case TTypeId_DECIMAL_TYPE: return "DECIMAL_TYPE" - case TTypeId_NULL_TYPE: return "NULL_TYPE" - case TTypeId_DATE_TYPE: return "DATE_TYPE" - case TTypeId_VARCHAR_TYPE: return "VARCHAR_TYPE" - case TTypeId_CHAR_TYPE: return "CHAR_TYPE" - case TTypeId_INTERVAL_YEAR_MONTH_TYPE: return "INTERVAL_YEAR_MONTH_TYPE" - case TTypeId_INTERVAL_DAY_TIME_TYPE: return "INTERVAL_DAY_TIME_TYPE" - } - return "" + switch p { + case TTypeId_BOOLEAN_TYPE: + return "BOOLEAN_TYPE" + case TTypeId_TINYINT_TYPE: + return "TINYINT_TYPE" + case TTypeId_SMALLINT_TYPE: + return "SMALLINT_TYPE" + case TTypeId_INT_TYPE: + return "INT_TYPE" + case TTypeId_BIGINT_TYPE: + return "BIGINT_TYPE" + case TTypeId_FLOAT_TYPE: + return "FLOAT_TYPE" + case TTypeId_DOUBLE_TYPE: + return "DOUBLE_TYPE" + case TTypeId_STRING_TYPE: + return "STRING_TYPE" + case TTypeId_TIMESTAMP_TYPE: + return "TIMESTAMP_TYPE" + case TTypeId_BINARY_TYPE: + return "BINARY_TYPE" + case TTypeId_ARRAY_TYPE: + return "ARRAY_TYPE" + case TTypeId_MAP_TYPE: + return "MAP_TYPE" + case TTypeId_STRUCT_TYPE: + return "STRUCT_TYPE" + case TTypeId_UNION_TYPE: + return "UNION_TYPE" + case TTypeId_USER_DEFINED_TYPE: + return "USER_DEFINED_TYPE" + case TTypeId_DECIMAL_TYPE: + return "DECIMAL_TYPE" + case TTypeId_NULL_TYPE: + return "NULL_TYPE" + case TTypeId_DATE_TYPE: + return "DATE_TYPE" + case TTypeId_VARCHAR_TYPE: + return "VARCHAR_TYPE" + case TTypeId_CHAR_TYPE: + return "CHAR_TYPE" + case TTypeId_INTERVAL_YEAR_MONTH_TYPE: + return "INTERVAL_YEAR_MONTH_TYPE" + case TTypeId_INTERVAL_DAY_TIME_TYPE: + return "INTERVAL_DAY_TIME_TYPE" + } + return "" } func TTypeIdFromString(s string) (TTypeId, error) { - switch s { - case "BOOLEAN_TYPE": return TTypeId_BOOLEAN_TYPE, nil - case "TINYINT_TYPE": return TTypeId_TINYINT_TYPE, nil - case "SMALLINT_TYPE": return TTypeId_SMALLINT_TYPE, nil - case "INT_TYPE": return TTypeId_INT_TYPE, nil - case "BIGINT_TYPE": return TTypeId_BIGINT_TYPE, nil - case "FLOAT_TYPE": return TTypeId_FLOAT_TYPE, nil - case "DOUBLE_TYPE": return TTypeId_DOUBLE_TYPE, nil - case "STRING_TYPE": return TTypeId_STRING_TYPE, nil - case "TIMESTAMP_TYPE": return TTypeId_TIMESTAMP_TYPE, nil - case "BINARY_TYPE": return TTypeId_BINARY_TYPE, nil - case "ARRAY_TYPE": return TTypeId_ARRAY_TYPE, nil - case "MAP_TYPE": return TTypeId_MAP_TYPE, nil - case "STRUCT_TYPE": return TTypeId_STRUCT_TYPE, nil - case "UNION_TYPE": return TTypeId_UNION_TYPE, nil - case "USER_DEFINED_TYPE": return TTypeId_USER_DEFINED_TYPE, nil - case "DECIMAL_TYPE": return TTypeId_DECIMAL_TYPE, nil - case "NULL_TYPE": return TTypeId_NULL_TYPE, nil - case "DATE_TYPE": return TTypeId_DATE_TYPE, nil - case "VARCHAR_TYPE": return TTypeId_VARCHAR_TYPE, nil - case "CHAR_TYPE": return TTypeId_CHAR_TYPE, nil - case "INTERVAL_YEAR_MONTH_TYPE": return TTypeId_INTERVAL_YEAR_MONTH_TYPE, nil - case "INTERVAL_DAY_TIME_TYPE": return TTypeId_INTERVAL_DAY_TIME_TYPE, nil - } - return TTypeId(0), fmt.Errorf("not a valid TTypeId string") + switch s { + case "BOOLEAN_TYPE": + return TTypeId_BOOLEAN_TYPE, nil + case "TINYINT_TYPE": + return TTypeId_TINYINT_TYPE, nil + case "SMALLINT_TYPE": + return TTypeId_SMALLINT_TYPE, nil + case "INT_TYPE": + return TTypeId_INT_TYPE, nil + case "BIGINT_TYPE": + return TTypeId_BIGINT_TYPE, nil + case "FLOAT_TYPE": + return TTypeId_FLOAT_TYPE, nil + case "DOUBLE_TYPE": + return TTypeId_DOUBLE_TYPE, nil + case "STRING_TYPE": + return TTypeId_STRING_TYPE, nil + case "TIMESTAMP_TYPE": + return TTypeId_TIMESTAMP_TYPE, nil + case "BINARY_TYPE": + return TTypeId_BINARY_TYPE, nil + case "ARRAY_TYPE": + return TTypeId_ARRAY_TYPE, nil + case "MAP_TYPE": + return TTypeId_MAP_TYPE, nil + case "STRUCT_TYPE": + return TTypeId_STRUCT_TYPE, nil + case "UNION_TYPE": + return TTypeId_UNION_TYPE, nil + case "USER_DEFINED_TYPE": + return TTypeId_USER_DEFINED_TYPE, nil + case "DECIMAL_TYPE": + return TTypeId_DECIMAL_TYPE, nil + case "NULL_TYPE": + return TTypeId_NULL_TYPE, nil + case "DATE_TYPE": + return TTypeId_DATE_TYPE, nil + case "VARCHAR_TYPE": + return TTypeId_VARCHAR_TYPE, nil + case "CHAR_TYPE": + return TTypeId_CHAR_TYPE, nil + case "INTERVAL_YEAR_MONTH_TYPE": + return TTypeId_INTERVAL_YEAR_MONTH_TYPE, nil + case "INTERVAL_DAY_TIME_TYPE": + return TTypeId_INTERVAL_DAY_TIME_TYPE, nil + } + return TTypeId(0), fmt.Errorf("not a valid TTypeId string") } - func TTypeIdPtr(v TTypeId) *TTypeId { return &v } func (p TTypeId) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TTypeId) UnmarshalText(text []byte) error { -q, err := TTypeIdFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TTypeIdFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TTypeId) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TTypeId(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TTypeId(v) + return nil } -func (p * TTypeId) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TTypeId) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TSparkRowSetType int64 + const ( - TSparkRowSetType_ARROW_BASED_SET TSparkRowSetType = 0 - TSparkRowSetType_COLUMN_BASED_SET TSparkRowSetType = 1 - TSparkRowSetType_ROW_BASED_SET TSparkRowSetType = 2 - TSparkRowSetType_URL_BASED_SET TSparkRowSetType = 3 + TSparkRowSetType_ARROW_BASED_SET TSparkRowSetType = 0 + TSparkRowSetType_COLUMN_BASED_SET TSparkRowSetType = 1 + TSparkRowSetType_ROW_BASED_SET TSparkRowSetType = 2 + TSparkRowSetType_URL_BASED_SET TSparkRowSetType = 3 ) func (p TSparkRowSetType) String() string { - switch p { - case TSparkRowSetType_ARROW_BASED_SET: return "ARROW_BASED_SET" - case TSparkRowSetType_COLUMN_BASED_SET: return "COLUMN_BASED_SET" - case TSparkRowSetType_ROW_BASED_SET: return "ROW_BASED_SET" - case TSparkRowSetType_URL_BASED_SET: return "URL_BASED_SET" - } - return "" + switch p { + case TSparkRowSetType_ARROW_BASED_SET: + return "ARROW_BASED_SET" + case TSparkRowSetType_COLUMN_BASED_SET: + return "COLUMN_BASED_SET" + case TSparkRowSetType_ROW_BASED_SET: + return "ROW_BASED_SET" + case TSparkRowSetType_URL_BASED_SET: + return "URL_BASED_SET" + } + return "" } func TSparkRowSetTypeFromString(s string) (TSparkRowSetType, error) { - switch s { - case "ARROW_BASED_SET": return TSparkRowSetType_ARROW_BASED_SET, nil - case "COLUMN_BASED_SET": return TSparkRowSetType_COLUMN_BASED_SET, nil - case "ROW_BASED_SET": return TSparkRowSetType_ROW_BASED_SET, nil - case "URL_BASED_SET": return TSparkRowSetType_URL_BASED_SET, nil - } - return TSparkRowSetType(0), fmt.Errorf("not a valid TSparkRowSetType string") + switch s { + case "ARROW_BASED_SET": + return TSparkRowSetType_ARROW_BASED_SET, nil + case "COLUMN_BASED_SET": + return TSparkRowSetType_COLUMN_BASED_SET, nil + case "ROW_BASED_SET": + return TSparkRowSetType_ROW_BASED_SET, nil + case "URL_BASED_SET": + return TSparkRowSetType_URL_BASED_SET, nil + } + return TSparkRowSetType(0), fmt.Errorf("not a valid TSparkRowSetType string") } - func TSparkRowSetTypePtr(v TSparkRowSetType) *TSparkRowSetType { return &v } func (p TSparkRowSetType) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TSparkRowSetType) UnmarshalText(text []byte) error { -q, err := TSparkRowSetTypeFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TSparkRowSetTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TSparkRowSetType) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TSparkRowSetType(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TSparkRowSetType(v) + return nil } -func (p * TSparkRowSetType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TSparkRowSetType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TDBSqlCompressionCodec int64 + const ( - TDBSqlCompressionCodec_NONE TDBSqlCompressionCodec = 0 - TDBSqlCompressionCodec_LZ4_FRAME TDBSqlCompressionCodec = 1 - TDBSqlCompressionCodec_LZ4_BLOCK TDBSqlCompressionCodec = 2 + TDBSqlCompressionCodec_NONE TDBSqlCompressionCodec = 0 + TDBSqlCompressionCodec_LZ4_FRAME TDBSqlCompressionCodec = 1 + TDBSqlCompressionCodec_LZ4_BLOCK TDBSqlCompressionCodec = 2 ) func (p TDBSqlCompressionCodec) String() string { - switch p { - case TDBSqlCompressionCodec_NONE: return "NONE" - case TDBSqlCompressionCodec_LZ4_FRAME: return "LZ4_FRAME" - case TDBSqlCompressionCodec_LZ4_BLOCK: return "LZ4_BLOCK" - } - return "" + switch p { + case TDBSqlCompressionCodec_NONE: + return "NONE" + case TDBSqlCompressionCodec_LZ4_FRAME: + return "LZ4_FRAME" + case TDBSqlCompressionCodec_LZ4_BLOCK: + return "LZ4_BLOCK" + } + return "" } func TDBSqlCompressionCodecFromString(s string) (TDBSqlCompressionCodec, error) { - switch s { - case "NONE": return TDBSqlCompressionCodec_NONE, nil - case "LZ4_FRAME": return TDBSqlCompressionCodec_LZ4_FRAME, nil - case "LZ4_BLOCK": return TDBSqlCompressionCodec_LZ4_BLOCK, nil - } - return TDBSqlCompressionCodec(0), fmt.Errorf("not a valid TDBSqlCompressionCodec string") + switch s { + case "NONE": + return TDBSqlCompressionCodec_NONE, nil + case "LZ4_FRAME": + return TDBSqlCompressionCodec_LZ4_FRAME, nil + case "LZ4_BLOCK": + return TDBSqlCompressionCodec_LZ4_BLOCK, nil + } + return TDBSqlCompressionCodec(0), fmt.Errorf("not a valid TDBSqlCompressionCodec string") } - func TDBSqlCompressionCodecPtr(v TDBSqlCompressionCodec) *TDBSqlCompressionCodec { return &v } func (p TDBSqlCompressionCodec) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TDBSqlCompressionCodec) UnmarshalText(text []byte) error { -q, err := TDBSqlCompressionCodecFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TDBSqlCompressionCodecFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TDBSqlCompressionCodec) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TDBSqlCompressionCodec(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TDBSqlCompressionCodec(v) + return nil } -func (p * TDBSqlCompressionCodec) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TDBSqlCompressionCodec) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TDBSqlArrowLayout int64 + const ( - TDBSqlArrowLayout_ARROW_BATCH TDBSqlArrowLayout = 0 - TDBSqlArrowLayout_ARROW_STREAMING TDBSqlArrowLayout = 1 + TDBSqlArrowLayout_ARROW_BATCH TDBSqlArrowLayout = 0 + TDBSqlArrowLayout_ARROW_STREAMING TDBSqlArrowLayout = 1 ) func (p TDBSqlArrowLayout) String() string { - switch p { - case TDBSqlArrowLayout_ARROW_BATCH: return "ARROW_BATCH" - case TDBSqlArrowLayout_ARROW_STREAMING: return "ARROW_STREAMING" - } - return "" + switch p { + case TDBSqlArrowLayout_ARROW_BATCH: + return "ARROW_BATCH" + case TDBSqlArrowLayout_ARROW_STREAMING: + return "ARROW_STREAMING" + } + return "" } func TDBSqlArrowLayoutFromString(s string) (TDBSqlArrowLayout, error) { - switch s { - case "ARROW_BATCH": return TDBSqlArrowLayout_ARROW_BATCH, nil - case "ARROW_STREAMING": return TDBSqlArrowLayout_ARROW_STREAMING, nil - } - return TDBSqlArrowLayout(0), fmt.Errorf("not a valid TDBSqlArrowLayout string") + switch s { + case "ARROW_BATCH": + return TDBSqlArrowLayout_ARROW_BATCH, nil + case "ARROW_STREAMING": + return TDBSqlArrowLayout_ARROW_STREAMING, nil + } + return TDBSqlArrowLayout(0), fmt.Errorf("not a valid TDBSqlArrowLayout string") } - func TDBSqlArrowLayoutPtr(v TDBSqlArrowLayout) *TDBSqlArrowLayout { return &v } func (p TDBSqlArrowLayout) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TDBSqlArrowLayout) UnmarshalText(text []byte) error { -q, err := TDBSqlArrowLayoutFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TDBSqlArrowLayoutFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TDBSqlArrowLayout) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TDBSqlArrowLayout(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TDBSqlArrowLayout(v) + return nil } -func (p * TDBSqlArrowLayout) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TDBSqlArrowLayout) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TStatusCode int64 + const ( - TStatusCode_SUCCESS_STATUS TStatusCode = 0 - TStatusCode_SUCCESS_WITH_INFO_STATUS TStatusCode = 1 - TStatusCode_STILL_EXECUTING_STATUS TStatusCode = 2 - TStatusCode_ERROR_STATUS TStatusCode = 3 - TStatusCode_INVALID_HANDLE_STATUS TStatusCode = 4 + TStatusCode_SUCCESS_STATUS TStatusCode = 0 + TStatusCode_SUCCESS_WITH_INFO_STATUS TStatusCode = 1 + TStatusCode_STILL_EXECUTING_STATUS TStatusCode = 2 + TStatusCode_ERROR_STATUS TStatusCode = 3 + TStatusCode_INVALID_HANDLE_STATUS TStatusCode = 4 ) func (p TStatusCode) String() string { - switch p { - case TStatusCode_SUCCESS_STATUS: return "SUCCESS_STATUS" - case TStatusCode_SUCCESS_WITH_INFO_STATUS: return "SUCCESS_WITH_INFO_STATUS" - case TStatusCode_STILL_EXECUTING_STATUS: return "STILL_EXECUTING_STATUS" - case TStatusCode_ERROR_STATUS: return "ERROR_STATUS" - case TStatusCode_INVALID_HANDLE_STATUS: return "INVALID_HANDLE_STATUS" - } - return "" + switch p { + case TStatusCode_SUCCESS_STATUS: + return "SUCCESS_STATUS" + case TStatusCode_SUCCESS_WITH_INFO_STATUS: + return "SUCCESS_WITH_INFO_STATUS" + case TStatusCode_STILL_EXECUTING_STATUS: + return "STILL_EXECUTING_STATUS" + case TStatusCode_ERROR_STATUS: + return "ERROR_STATUS" + case TStatusCode_INVALID_HANDLE_STATUS: + return "INVALID_HANDLE_STATUS" + } + return "" } func TStatusCodeFromString(s string) (TStatusCode, error) { - switch s { - case "SUCCESS_STATUS": return TStatusCode_SUCCESS_STATUS, nil - case "SUCCESS_WITH_INFO_STATUS": return TStatusCode_SUCCESS_WITH_INFO_STATUS, nil - case "STILL_EXECUTING_STATUS": return TStatusCode_STILL_EXECUTING_STATUS, nil - case "ERROR_STATUS": return TStatusCode_ERROR_STATUS, nil - case "INVALID_HANDLE_STATUS": return TStatusCode_INVALID_HANDLE_STATUS, nil - } - return TStatusCode(0), fmt.Errorf("not a valid TStatusCode string") + switch s { + case "SUCCESS_STATUS": + return TStatusCode_SUCCESS_STATUS, nil + case "SUCCESS_WITH_INFO_STATUS": + return TStatusCode_SUCCESS_WITH_INFO_STATUS, nil + case "STILL_EXECUTING_STATUS": + return TStatusCode_STILL_EXECUTING_STATUS, nil + case "ERROR_STATUS": + return TStatusCode_ERROR_STATUS, nil + case "INVALID_HANDLE_STATUS": + return TStatusCode_INVALID_HANDLE_STATUS, nil + } + return TStatusCode(0), fmt.Errorf("not a valid TStatusCode string") } - func TStatusCodePtr(v TStatusCode) *TStatusCode { return &v } func (p TStatusCode) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TStatusCode) UnmarshalText(text []byte) error { -q, err := TStatusCodeFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TStatusCodeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TStatusCode) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TStatusCode(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TStatusCode(v) + return nil } -func (p * TStatusCode) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TStatusCode) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TOperationState int64 + const ( - TOperationState_INITIALIZED_STATE TOperationState = 0 - TOperationState_RUNNING_STATE TOperationState = 1 - TOperationState_FINISHED_STATE TOperationState = 2 - TOperationState_CANCELED_STATE TOperationState = 3 - TOperationState_CLOSED_STATE TOperationState = 4 - TOperationState_ERROR_STATE TOperationState = 5 - TOperationState_UKNOWN_STATE TOperationState = 6 - TOperationState_PENDING_STATE TOperationState = 7 - TOperationState_TIMEDOUT_STATE TOperationState = 8 + TOperationState_INITIALIZED_STATE TOperationState = 0 + TOperationState_RUNNING_STATE TOperationState = 1 + TOperationState_FINISHED_STATE TOperationState = 2 + TOperationState_CANCELED_STATE TOperationState = 3 + TOperationState_CLOSED_STATE TOperationState = 4 + TOperationState_ERROR_STATE TOperationState = 5 + TOperationState_UKNOWN_STATE TOperationState = 6 + TOperationState_PENDING_STATE TOperationState = 7 + TOperationState_TIMEDOUT_STATE TOperationState = 8 ) func (p TOperationState) String() string { - switch p { - case TOperationState_INITIALIZED_STATE: return "INITIALIZED_STATE" - case TOperationState_RUNNING_STATE: return "RUNNING_STATE" - case TOperationState_FINISHED_STATE: return "FINISHED_STATE" - case TOperationState_CANCELED_STATE: return "CANCELED_STATE" - case TOperationState_CLOSED_STATE: return "CLOSED_STATE" - case TOperationState_ERROR_STATE: return "ERROR_STATE" - case TOperationState_UKNOWN_STATE: return "UKNOWN_STATE" - case TOperationState_PENDING_STATE: return "PENDING_STATE" - case TOperationState_TIMEDOUT_STATE: return "TIMEDOUT_STATE" - } - return "" + switch p { + case TOperationState_INITIALIZED_STATE: + return "INITIALIZED_STATE" + case TOperationState_RUNNING_STATE: + return "RUNNING_STATE" + case TOperationState_FINISHED_STATE: + return "FINISHED_STATE" + case TOperationState_CANCELED_STATE: + return "CANCELED_STATE" + case TOperationState_CLOSED_STATE: + return "CLOSED_STATE" + case TOperationState_ERROR_STATE: + return "ERROR_STATE" + case TOperationState_UKNOWN_STATE: + return "UKNOWN_STATE" + case TOperationState_PENDING_STATE: + return "PENDING_STATE" + case TOperationState_TIMEDOUT_STATE: + return "TIMEDOUT_STATE" + } + return "" } func TOperationStateFromString(s string) (TOperationState, error) { - switch s { - case "INITIALIZED_STATE": return TOperationState_INITIALIZED_STATE, nil - case "RUNNING_STATE": return TOperationState_RUNNING_STATE, nil - case "FINISHED_STATE": return TOperationState_FINISHED_STATE, nil - case "CANCELED_STATE": return TOperationState_CANCELED_STATE, nil - case "CLOSED_STATE": return TOperationState_CLOSED_STATE, nil - case "ERROR_STATE": return TOperationState_ERROR_STATE, nil - case "UKNOWN_STATE": return TOperationState_UKNOWN_STATE, nil - case "PENDING_STATE": return TOperationState_PENDING_STATE, nil - case "TIMEDOUT_STATE": return TOperationState_TIMEDOUT_STATE, nil - } - return TOperationState(0), fmt.Errorf("not a valid TOperationState string") + switch s { + case "INITIALIZED_STATE": + return TOperationState_INITIALIZED_STATE, nil + case "RUNNING_STATE": + return TOperationState_RUNNING_STATE, nil + case "FINISHED_STATE": + return TOperationState_FINISHED_STATE, nil + case "CANCELED_STATE": + return TOperationState_CANCELED_STATE, nil + case "CLOSED_STATE": + return TOperationState_CLOSED_STATE, nil + case "ERROR_STATE": + return TOperationState_ERROR_STATE, nil + case "UKNOWN_STATE": + return TOperationState_UKNOWN_STATE, nil + case "PENDING_STATE": + return TOperationState_PENDING_STATE, nil + case "TIMEDOUT_STATE": + return TOperationState_TIMEDOUT_STATE, nil + } + return TOperationState(0), fmt.Errorf("not a valid TOperationState string") } - func TOperationStatePtr(v TOperationState) *TOperationState { return &v } func (p TOperationState) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TOperationState) UnmarshalText(text []byte) error { -q, err := TOperationStateFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TOperationStateFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TOperationState) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TOperationState(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TOperationState(v) + return nil } -func (p * TOperationState) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TOperationState) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TOperationType int64 + const ( - TOperationType_EXECUTE_STATEMENT TOperationType = 0 - TOperationType_GET_TYPE_INFO TOperationType = 1 - TOperationType_GET_CATALOGS TOperationType = 2 - TOperationType_GET_SCHEMAS TOperationType = 3 - TOperationType_GET_TABLES TOperationType = 4 - TOperationType_GET_TABLE_TYPES TOperationType = 5 - TOperationType_GET_COLUMNS TOperationType = 6 - TOperationType_GET_FUNCTIONS TOperationType = 7 - TOperationType_UNKNOWN TOperationType = 8 + TOperationType_EXECUTE_STATEMENT TOperationType = 0 + TOperationType_GET_TYPE_INFO TOperationType = 1 + TOperationType_GET_CATALOGS TOperationType = 2 + TOperationType_GET_SCHEMAS TOperationType = 3 + TOperationType_GET_TABLES TOperationType = 4 + TOperationType_GET_TABLE_TYPES TOperationType = 5 + TOperationType_GET_COLUMNS TOperationType = 6 + TOperationType_GET_FUNCTIONS TOperationType = 7 + TOperationType_UNKNOWN TOperationType = 8 ) func (p TOperationType) String() string { - switch p { - case TOperationType_EXECUTE_STATEMENT: return "EXECUTE_STATEMENT" - case TOperationType_GET_TYPE_INFO: return "GET_TYPE_INFO" - case TOperationType_GET_CATALOGS: return "GET_CATALOGS" - case TOperationType_GET_SCHEMAS: return "GET_SCHEMAS" - case TOperationType_GET_TABLES: return "GET_TABLES" - case TOperationType_GET_TABLE_TYPES: return "GET_TABLE_TYPES" - case TOperationType_GET_COLUMNS: return "GET_COLUMNS" - case TOperationType_GET_FUNCTIONS: return "GET_FUNCTIONS" - case TOperationType_UNKNOWN: return "UNKNOWN" - } - return "" + switch p { + case TOperationType_EXECUTE_STATEMENT: + return "EXECUTE_STATEMENT" + case TOperationType_GET_TYPE_INFO: + return "GET_TYPE_INFO" + case TOperationType_GET_CATALOGS: + return "GET_CATALOGS" + case TOperationType_GET_SCHEMAS: + return "GET_SCHEMAS" + case TOperationType_GET_TABLES: + return "GET_TABLES" + case TOperationType_GET_TABLE_TYPES: + return "GET_TABLE_TYPES" + case TOperationType_GET_COLUMNS: + return "GET_COLUMNS" + case TOperationType_GET_FUNCTIONS: + return "GET_FUNCTIONS" + case TOperationType_UNKNOWN: + return "UNKNOWN" + } + return "" } func TOperationTypeFromString(s string) (TOperationType, error) { - switch s { - case "EXECUTE_STATEMENT": return TOperationType_EXECUTE_STATEMENT, nil - case "GET_TYPE_INFO": return TOperationType_GET_TYPE_INFO, nil - case "GET_CATALOGS": return TOperationType_GET_CATALOGS, nil - case "GET_SCHEMAS": return TOperationType_GET_SCHEMAS, nil - case "GET_TABLES": return TOperationType_GET_TABLES, nil - case "GET_TABLE_TYPES": return TOperationType_GET_TABLE_TYPES, nil - case "GET_COLUMNS": return TOperationType_GET_COLUMNS, nil - case "GET_FUNCTIONS": return TOperationType_GET_FUNCTIONS, nil - case "UNKNOWN": return TOperationType_UNKNOWN, nil - } - return TOperationType(0), fmt.Errorf("not a valid TOperationType string") + switch s { + case "EXECUTE_STATEMENT": + return TOperationType_EXECUTE_STATEMENT, nil + case "GET_TYPE_INFO": + return TOperationType_GET_TYPE_INFO, nil + case "GET_CATALOGS": + return TOperationType_GET_CATALOGS, nil + case "GET_SCHEMAS": + return TOperationType_GET_SCHEMAS, nil + case "GET_TABLES": + return TOperationType_GET_TABLES, nil + case "GET_TABLE_TYPES": + return TOperationType_GET_TABLE_TYPES, nil + case "GET_COLUMNS": + return TOperationType_GET_COLUMNS, nil + case "GET_FUNCTIONS": + return TOperationType_GET_FUNCTIONS, nil + case "UNKNOWN": + return TOperationType_UNKNOWN, nil + } + return TOperationType(0), fmt.Errorf("not a valid TOperationType string") } - func TOperationTypePtr(v TOperationType) *TOperationType { return &v } func (p TOperationType) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TOperationType) UnmarshalText(text []byte) error { -q, err := TOperationTypeFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TOperationTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TOperationType) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TOperationType(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TOperationType(v) + return nil } -func (p * TOperationType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TOperationType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TGetInfoType int64 + const ( - TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS TGetInfoType = 0 - TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES TGetInfoType = 1 - TGetInfoType_CLI_DATA_SOURCE_NAME TGetInfoType = 2 - TGetInfoType_CLI_FETCH_DIRECTION TGetInfoType = 8 - TGetInfoType_CLI_SERVER_NAME TGetInfoType = 13 - TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE TGetInfoType = 14 - TGetInfoType_CLI_DBMS_NAME TGetInfoType = 17 - TGetInfoType_CLI_DBMS_VER TGetInfoType = 18 - TGetInfoType_CLI_ACCESSIBLE_TABLES TGetInfoType = 19 - TGetInfoType_CLI_ACCESSIBLE_PROCEDURES TGetInfoType = 20 - TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR TGetInfoType = 23 - TGetInfoType_CLI_DATA_SOURCE_READ_ONLY TGetInfoType = 25 - TGetInfoType_CLI_DEFAULT_TXN_ISOLATION TGetInfoType = 26 - TGetInfoType_CLI_IDENTIFIER_CASE TGetInfoType = 28 - TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR TGetInfoType = 29 - TGetInfoType_CLI_MAX_COLUMN_NAME_LEN TGetInfoType = 30 - TGetInfoType_CLI_MAX_CURSOR_NAME_LEN TGetInfoType = 31 - TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN TGetInfoType = 32 - TGetInfoType_CLI_MAX_CATALOG_NAME_LEN TGetInfoType = 34 - TGetInfoType_CLI_MAX_TABLE_NAME_LEN TGetInfoType = 35 - TGetInfoType_CLI_SCROLL_CONCURRENCY TGetInfoType = 43 - TGetInfoType_CLI_TXN_CAPABLE TGetInfoType = 46 - TGetInfoType_CLI_USER_NAME TGetInfoType = 47 - TGetInfoType_CLI_TXN_ISOLATION_OPTION TGetInfoType = 72 - TGetInfoType_CLI_INTEGRITY TGetInfoType = 73 - TGetInfoType_CLI_GETDATA_EXTENSIONS TGetInfoType = 81 - TGetInfoType_CLI_NULL_COLLATION TGetInfoType = 85 - TGetInfoType_CLI_ALTER_TABLE TGetInfoType = 86 - TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT TGetInfoType = 90 - TGetInfoType_CLI_SPECIAL_CHARACTERS TGetInfoType = 94 - TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY TGetInfoType = 97 - TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX TGetInfoType = 98 - TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY TGetInfoType = 99 - TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT TGetInfoType = 100 - TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE TGetInfoType = 101 - TGetInfoType_CLI_MAX_INDEX_SIZE TGetInfoType = 102 - TGetInfoType_CLI_MAX_ROW_SIZE TGetInfoType = 104 - TGetInfoType_CLI_MAX_STATEMENT_LEN TGetInfoType = 105 - TGetInfoType_CLI_MAX_TABLES_IN_SELECT TGetInfoType = 106 - TGetInfoType_CLI_MAX_USER_NAME_LEN TGetInfoType = 107 - TGetInfoType_CLI_OJ_CAPABILITIES TGetInfoType = 115 - TGetInfoType_CLI_XOPEN_CLI_YEAR TGetInfoType = 10000 - TGetInfoType_CLI_CURSOR_SENSITIVITY TGetInfoType = 10001 - TGetInfoType_CLI_DESCRIBE_PARAMETER TGetInfoType = 10002 - TGetInfoType_CLI_CATALOG_NAME TGetInfoType = 10003 - TGetInfoType_CLI_COLLATION_SEQ TGetInfoType = 10004 - TGetInfoType_CLI_MAX_IDENTIFIER_LEN TGetInfoType = 10005 + TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS TGetInfoType = 0 + TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES TGetInfoType = 1 + TGetInfoType_CLI_DATA_SOURCE_NAME TGetInfoType = 2 + TGetInfoType_CLI_FETCH_DIRECTION TGetInfoType = 8 + TGetInfoType_CLI_SERVER_NAME TGetInfoType = 13 + TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE TGetInfoType = 14 + TGetInfoType_CLI_DBMS_NAME TGetInfoType = 17 + TGetInfoType_CLI_DBMS_VER TGetInfoType = 18 + TGetInfoType_CLI_ACCESSIBLE_TABLES TGetInfoType = 19 + TGetInfoType_CLI_ACCESSIBLE_PROCEDURES TGetInfoType = 20 + TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR TGetInfoType = 23 + TGetInfoType_CLI_DATA_SOURCE_READ_ONLY TGetInfoType = 25 + TGetInfoType_CLI_DEFAULT_TXN_ISOLATION TGetInfoType = 26 + TGetInfoType_CLI_IDENTIFIER_CASE TGetInfoType = 28 + TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR TGetInfoType = 29 + TGetInfoType_CLI_MAX_COLUMN_NAME_LEN TGetInfoType = 30 + TGetInfoType_CLI_MAX_CURSOR_NAME_LEN TGetInfoType = 31 + TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN TGetInfoType = 32 + TGetInfoType_CLI_MAX_CATALOG_NAME_LEN TGetInfoType = 34 + TGetInfoType_CLI_MAX_TABLE_NAME_LEN TGetInfoType = 35 + TGetInfoType_CLI_SCROLL_CONCURRENCY TGetInfoType = 43 + TGetInfoType_CLI_TXN_CAPABLE TGetInfoType = 46 + TGetInfoType_CLI_USER_NAME TGetInfoType = 47 + TGetInfoType_CLI_TXN_ISOLATION_OPTION TGetInfoType = 72 + TGetInfoType_CLI_INTEGRITY TGetInfoType = 73 + TGetInfoType_CLI_GETDATA_EXTENSIONS TGetInfoType = 81 + TGetInfoType_CLI_NULL_COLLATION TGetInfoType = 85 + TGetInfoType_CLI_ALTER_TABLE TGetInfoType = 86 + TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT TGetInfoType = 90 + TGetInfoType_CLI_SPECIAL_CHARACTERS TGetInfoType = 94 + TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY TGetInfoType = 97 + TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX TGetInfoType = 98 + TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY TGetInfoType = 99 + TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT TGetInfoType = 100 + TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE TGetInfoType = 101 + TGetInfoType_CLI_MAX_INDEX_SIZE TGetInfoType = 102 + TGetInfoType_CLI_MAX_ROW_SIZE TGetInfoType = 104 + TGetInfoType_CLI_MAX_STATEMENT_LEN TGetInfoType = 105 + TGetInfoType_CLI_MAX_TABLES_IN_SELECT TGetInfoType = 106 + TGetInfoType_CLI_MAX_USER_NAME_LEN TGetInfoType = 107 + TGetInfoType_CLI_OJ_CAPABILITIES TGetInfoType = 115 + TGetInfoType_CLI_XOPEN_CLI_YEAR TGetInfoType = 10000 + TGetInfoType_CLI_CURSOR_SENSITIVITY TGetInfoType = 10001 + TGetInfoType_CLI_DESCRIBE_PARAMETER TGetInfoType = 10002 + TGetInfoType_CLI_CATALOG_NAME TGetInfoType = 10003 + TGetInfoType_CLI_COLLATION_SEQ TGetInfoType = 10004 + TGetInfoType_CLI_MAX_IDENTIFIER_LEN TGetInfoType = 10005 ) func (p TGetInfoType) String() string { - switch p { - case TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS: return "CLI_MAX_DRIVER_CONNECTIONS" - case TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES: return "CLI_MAX_CONCURRENT_ACTIVITIES" - case TGetInfoType_CLI_DATA_SOURCE_NAME: return "CLI_DATA_SOURCE_NAME" - case TGetInfoType_CLI_FETCH_DIRECTION: return "CLI_FETCH_DIRECTION" - case TGetInfoType_CLI_SERVER_NAME: return "CLI_SERVER_NAME" - case TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE: return "CLI_SEARCH_PATTERN_ESCAPE" - case TGetInfoType_CLI_DBMS_NAME: return "CLI_DBMS_NAME" - case TGetInfoType_CLI_DBMS_VER: return "CLI_DBMS_VER" - case TGetInfoType_CLI_ACCESSIBLE_TABLES: return "CLI_ACCESSIBLE_TABLES" - case TGetInfoType_CLI_ACCESSIBLE_PROCEDURES: return "CLI_ACCESSIBLE_PROCEDURES" - case TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR: return "CLI_CURSOR_COMMIT_BEHAVIOR" - case TGetInfoType_CLI_DATA_SOURCE_READ_ONLY: return "CLI_DATA_SOURCE_READ_ONLY" - case TGetInfoType_CLI_DEFAULT_TXN_ISOLATION: return "CLI_DEFAULT_TXN_ISOLATION" - case TGetInfoType_CLI_IDENTIFIER_CASE: return "CLI_IDENTIFIER_CASE" - case TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR: return "CLI_IDENTIFIER_QUOTE_CHAR" - case TGetInfoType_CLI_MAX_COLUMN_NAME_LEN: return "CLI_MAX_COLUMN_NAME_LEN" - case TGetInfoType_CLI_MAX_CURSOR_NAME_LEN: return "CLI_MAX_CURSOR_NAME_LEN" - case TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN: return "CLI_MAX_SCHEMA_NAME_LEN" - case TGetInfoType_CLI_MAX_CATALOG_NAME_LEN: return "CLI_MAX_CATALOG_NAME_LEN" - case TGetInfoType_CLI_MAX_TABLE_NAME_LEN: return "CLI_MAX_TABLE_NAME_LEN" - case TGetInfoType_CLI_SCROLL_CONCURRENCY: return "CLI_SCROLL_CONCURRENCY" - case TGetInfoType_CLI_TXN_CAPABLE: return "CLI_TXN_CAPABLE" - case TGetInfoType_CLI_USER_NAME: return "CLI_USER_NAME" - case TGetInfoType_CLI_TXN_ISOLATION_OPTION: return "CLI_TXN_ISOLATION_OPTION" - case TGetInfoType_CLI_INTEGRITY: return "CLI_INTEGRITY" - case TGetInfoType_CLI_GETDATA_EXTENSIONS: return "CLI_GETDATA_EXTENSIONS" - case TGetInfoType_CLI_NULL_COLLATION: return "CLI_NULL_COLLATION" - case TGetInfoType_CLI_ALTER_TABLE: return "CLI_ALTER_TABLE" - case TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT: return "CLI_ORDER_BY_COLUMNS_IN_SELECT" - case TGetInfoType_CLI_SPECIAL_CHARACTERS: return "CLI_SPECIAL_CHARACTERS" - case TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY: return "CLI_MAX_COLUMNS_IN_GROUP_BY" - case TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX: return "CLI_MAX_COLUMNS_IN_INDEX" - case TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY: return "CLI_MAX_COLUMNS_IN_ORDER_BY" - case TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT: return "CLI_MAX_COLUMNS_IN_SELECT" - case TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE: return "CLI_MAX_COLUMNS_IN_TABLE" - case TGetInfoType_CLI_MAX_INDEX_SIZE: return "CLI_MAX_INDEX_SIZE" - case TGetInfoType_CLI_MAX_ROW_SIZE: return "CLI_MAX_ROW_SIZE" - case TGetInfoType_CLI_MAX_STATEMENT_LEN: return "CLI_MAX_STATEMENT_LEN" - case TGetInfoType_CLI_MAX_TABLES_IN_SELECT: return "CLI_MAX_TABLES_IN_SELECT" - case TGetInfoType_CLI_MAX_USER_NAME_LEN: return "CLI_MAX_USER_NAME_LEN" - case TGetInfoType_CLI_OJ_CAPABILITIES: return "CLI_OJ_CAPABILITIES" - case TGetInfoType_CLI_XOPEN_CLI_YEAR: return "CLI_XOPEN_CLI_YEAR" - case TGetInfoType_CLI_CURSOR_SENSITIVITY: return "CLI_CURSOR_SENSITIVITY" - case TGetInfoType_CLI_DESCRIBE_PARAMETER: return "CLI_DESCRIBE_PARAMETER" - case TGetInfoType_CLI_CATALOG_NAME: return "CLI_CATALOG_NAME" - case TGetInfoType_CLI_COLLATION_SEQ: return "CLI_COLLATION_SEQ" - case TGetInfoType_CLI_MAX_IDENTIFIER_LEN: return "CLI_MAX_IDENTIFIER_LEN" - } - return "" + switch p { + case TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS: + return "CLI_MAX_DRIVER_CONNECTIONS" + case TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES: + return "CLI_MAX_CONCURRENT_ACTIVITIES" + case TGetInfoType_CLI_DATA_SOURCE_NAME: + return "CLI_DATA_SOURCE_NAME" + case TGetInfoType_CLI_FETCH_DIRECTION: + return "CLI_FETCH_DIRECTION" + case TGetInfoType_CLI_SERVER_NAME: + return "CLI_SERVER_NAME" + case TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE: + return "CLI_SEARCH_PATTERN_ESCAPE" + case TGetInfoType_CLI_DBMS_NAME: + return "CLI_DBMS_NAME" + case TGetInfoType_CLI_DBMS_VER: + return "CLI_DBMS_VER" + case TGetInfoType_CLI_ACCESSIBLE_TABLES: + return "CLI_ACCESSIBLE_TABLES" + case TGetInfoType_CLI_ACCESSIBLE_PROCEDURES: + return "CLI_ACCESSIBLE_PROCEDURES" + case TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR: + return "CLI_CURSOR_COMMIT_BEHAVIOR" + case TGetInfoType_CLI_DATA_SOURCE_READ_ONLY: + return "CLI_DATA_SOURCE_READ_ONLY" + case TGetInfoType_CLI_DEFAULT_TXN_ISOLATION: + return "CLI_DEFAULT_TXN_ISOLATION" + case TGetInfoType_CLI_IDENTIFIER_CASE: + return "CLI_IDENTIFIER_CASE" + case TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR: + return "CLI_IDENTIFIER_QUOTE_CHAR" + case TGetInfoType_CLI_MAX_COLUMN_NAME_LEN: + return "CLI_MAX_COLUMN_NAME_LEN" + case TGetInfoType_CLI_MAX_CURSOR_NAME_LEN: + return "CLI_MAX_CURSOR_NAME_LEN" + case TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN: + return "CLI_MAX_SCHEMA_NAME_LEN" + case TGetInfoType_CLI_MAX_CATALOG_NAME_LEN: + return "CLI_MAX_CATALOG_NAME_LEN" + case TGetInfoType_CLI_MAX_TABLE_NAME_LEN: + return "CLI_MAX_TABLE_NAME_LEN" + case TGetInfoType_CLI_SCROLL_CONCURRENCY: + return "CLI_SCROLL_CONCURRENCY" + case TGetInfoType_CLI_TXN_CAPABLE: + return "CLI_TXN_CAPABLE" + case TGetInfoType_CLI_USER_NAME: + return "CLI_USER_NAME" + case TGetInfoType_CLI_TXN_ISOLATION_OPTION: + return "CLI_TXN_ISOLATION_OPTION" + case TGetInfoType_CLI_INTEGRITY: + return "CLI_INTEGRITY" + case TGetInfoType_CLI_GETDATA_EXTENSIONS: + return "CLI_GETDATA_EXTENSIONS" + case TGetInfoType_CLI_NULL_COLLATION: + return "CLI_NULL_COLLATION" + case TGetInfoType_CLI_ALTER_TABLE: + return "CLI_ALTER_TABLE" + case TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT: + return "CLI_ORDER_BY_COLUMNS_IN_SELECT" + case TGetInfoType_CLI_SPECIAL_CHARACTERS: + return "CLI_SPECIAL_CHARACTERS" + case TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY: + return "CLI_MAX_COLUMNS_IN_GROUP_BY" + case TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX: + return "CLI_MAX_COLUMNS_IN_INDEX" + case TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY: + return "CLI_MAX_COLUMNS_IN_ORDER_BY" + case TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT: + return "CLI_MAX_COLUMNS_IN_SELECT" + case TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE: + return "CLI_MAX_COLUMNS_IN_TABLE" + case TGetInfoType_CLI_MAX_INDEX_SIZE: + return "CLI_MAX_INDEX_SIZE" + case TGetInfoType_CLI_MAX_ROW_SIZE: + return "CLI_MAX_ROW_SIZE" + case TGetInfoType_CLI_MAX_STATEMENT_LEN: + return "CLI_MAX_STATEMENT_LEN" + case TGetInfoType_CLI_MAX_TABLES_IN_SELECT: + return "CLI_MAX_TABLES_IN_SELECT" + case TGetInfoType_CLI_MAX_USER_NAME_LEN: + return "CLI_MAX_USER_NAME_LEN" + case TGetInfoType_CLI_OJ_CAPABILITIES: + return "CLI_OJ_CAPABILITIES" + case TGetInfoType_CLI_XOPEN_CLI_YEAR: + return "CLI_XOPEN_CLI_YEAR" + case TGetInfoType_CLI_CURSOR_SENSITIVITY: + return "CLI_CURSOR_SENSITIVITY" + case TGetInfoType_CLI_DESCRIBE_PARAMETER: + return "CLI_DESCRIBE_PARAMETER" + case TGetInfoType_CLI_CATALOG_NAME: + return "CLI_CATALOG_NAME" + case TGetInfoType_CLI_COLLATION_SEQ: + return "CLI_COLLATION_SEQ" + case TGetInfoType_CLI_MAX_IDENTIFIER_LEN: + return "CLI_MAX_IDENTIFIER_LEN" + } + return "" } func TGetInfoTypeFromString(s string) (TGetInfoType, error) { - switch s { - case "CLI_MAX_DRIVER_CONNECTIONS": return TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS, nil - case "CLI_MAX_CONCURRENT_ACTIVITIES": return TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES, nil - case "CLI_DATA_SOURCE_NAME": return TGetInfoType_CLI_DATA_SOURCE_NAME, nil - case "CLI_FETCH_DIRECTION": return TGetInfoType_CLI_FETCH_DIRECTION, nil - case "CLI_SERVER_NAME": return TGetInfoType_CLI_SERVER_NAME, nil - case "CLI_SEARCH_PATTERN_ESCAPE": return TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE, nil - case "CLI_DBMS_NAME": return TGetInfoType_CLI_DBMS_NAME, nil - case "CLI_DBMS_VER": return TGetInfoType_CLI_DBMS_VER, nil - case "CLI_ACCESSIBLE_TABLES": return TGetInfoType_CLI_ACCESSIBLE_TABLES, nil - case "CLI_ACCESSIBLE_PROCEDURES": return TGetInfoType_CLI_ACCESSIBLE_PROCEDURES, nil - case "CLI_CURSOR_COMMIT_BEHAVIOR": return TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR, nil - case "CLI_DATA_SOURCE_READ_ONLY": return TGetInfoType_CLI_DATA_SOURCE_READ_ONLY, nil - case "CLI_DEFAULT_TXN_ISOLATION": return TGetInfoType_CLI_DEFAULT_TXN_ISOLATION, nil - case "CLI_IDENTIFIER_CASE": return TGetInfoType_CLI_IDENTIFIER_CASE, nil - case "CLI_IDENTIFIER_QUOTE_CHAR": return TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR, nil - case "CLI_MAX_COLUMN_NAME_LEN": return TGetInfoType_CLI_MAX_COLUMN_NAME_LEN, nil - case "CLI_MAX_CURSOR_NAME_LEN": return TGetInfoType_CLI_MAX_CURSOR_NAME_LEN, nil - case "CLI_MAX_SCHEMA_NAME_LEN": return TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN, nil - case "CLI_MAX_CATALOG_NAME_LEN": return TGetInfoType_CLI_MAX_CATALOG_NAME_LEN, nil - case "CLI_MAX_TABLE_NAME_LEN": return TGetInfoType_CLI_MAX_TABLE_NAME_LEN, nil - case "CLI_SCROLL_CONCURRENCY": return TGetInfoType_CLI_SCROLL_CONCURRENCY, nil - case "CLI_TXN_CAPABLE": return TGetInfoType_CLI_TXN_CAPABLE, nil - case "CLI_USER_NAME": return TGetInfoType_CLI_USER_NAME, nil - case "CLI_TXN_ISOLATION_OPTION": return TGetInfoType_CLI_TXN_ISOLATION_OPTION, nil - case "CLI_INTEGRITY": return TGetInfoType_CLI_INTEGRITY, nil - case "CLI_GETDATA_EXTENSIONS": return TGetInfoType_CLI_GETDATA_EXTENSIONS, nil - case "CLI_NULL_COLLATION": return TGetInfoType_CLI_NULL_COLLATION, nil - case "CLI_ALTER_TABLE": return TGetInfoType_CLI_ALTER_TABLE, nil - case "CLI_ORDER_BY_COLUMNS_IN_SELECT": return TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT, nil - case "CLI_SPECIAL_CHARACTERS": return TGetInfoType_CLI_SPECIAL_CHARACTERS, nil - case "CLI_MAX_COLUMNS_IN_GROUP_BY": return TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY, nil - case "CLI_MAX_COLUMNS_IN_INDEX": return TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX, nil - case "CLI_MAX_COLUMNS_IN_ORDER_BY": return TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY, nil - case "CLI_MAX_COLUMNS_IN_SELECT": return TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT, nil - case "CLI_MAX_COLUMNS_IN_TABLE": return TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE, nil - case "CLI_MAX_INDEX_SIZE": return TGetInfoType_CLI_MAX_INDEX_SIZE, nil - case "CLI_MAX_ROW_SIZE": return TGetInfoType_CLI_MAX_ROW_SIZE, nil - case "CLI_MAX_STATEMENT_LEN": return TGetInfoType_CLI_MAX_STATEMENT_LEN, nil - case "CLI_MAX_TABLES_IN_SELECT": return TGetInfoType_CLI_MAX_TABLES_IN_SELECT, nil - case "CLI_MAX_USER_NAME_LEN": return TGetInfoType_CLI_MAX_USER_NAME_LEN, nil - case "CLI_OJ_CAPABILITIES": return TGetInfoType_CLI_OJ_CAPABILITIES, nil - case "CLI_XOPEN_CLI_YEAR": return TGetInfoType_CLI_XOPEN_CLI_YEAR, nil - case "CLI_CURSOR_SENSITIVITY": return TGetInfoType_CLI_CURSOR_SENSITIVITY, nil - case "CLI_DESCRIBE_PARAMETER": return TGetInfoType_CLI_DESCRIBE_PARAMETER, nil - case "CLI_CATALOG_NAME": return TGetInfoType_CLI_CATALOG_NAME, nil - case "CLI_COLLATION_SEQ": return TGetInfoType_CLI_COLLATION_SEQ, nil - case "CLI_MAX_IDENTIFIER_LEN": return TGetInfoType_CLI_MAX_IDENTIFIER_LEN, nil - } - return TGetInfoType(0), fmt.Errorf("not a valid TGetInfoType string") + switch s { + case "CLI_MAX_DRIVER_CONNECTIONS": + return TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS, nil + case "CLI_MAX_CONCURRENT_ACTIVITIES": + return TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES, nil + case "CLI_DATA_SOURCE_NAME": + return TGetInfoType_CLI_DATA_SOURCE_NAME, nil + case "CLI_FETCH_DIRECTION": + return TGetInfoType_CLI_FETCH_DIRECTION, nil + case "CLI_SERVER_NAME": + return TGetInfoType_CLI_SERVER_NAME, nil + case "CLI_SEARCH_PATTERN_ESCAPE": + return TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE, nil + case "CLI_DBMS_NAME": + return TGetInfoType_CLI_DBMS_NAME, nil + case "CLI_DBMS_VER": + return TGetInfoType_CLI_DBMS_VER, nil + case "CLI_ACCESSIBLE_TABLES": + return TGetInfoType_CLI_ACCESSIBLE_TABLES, nil + case "CLI_ACCESSIBLE_PROCEDURES": + return TGetInfoType_CLI_ACCESSIBLE_PROCEDURES, nil + case "CLI_CURSOR_COMMIT_BEHAVIOR": + return TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR, nil + case "CLI_DATA_SOURCE_READ_ONLY": + return TGetInfoType_CLI_DATA_SOURCE_READ_ONLY, nil + case "CLI_DEFAULT_TXN_ISOLATION": + return TGetInfoType_CLI_DEFAULT_TXN_ISOLATION, nil + case "CLI_IDENTIFIER_CASE": + return TGetInfoType_CLI_IDENTIFIER_CASE, nil + case "CLI_IDENTIFIER_QUOTE_CHAR": + return TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR, nil + case "CLI_MAX_COLUMN_NAME_LEN": + return TGetInfoType_CLI_MAX_COLUMN_NAME_LEN, nil + case "CLI_MAX_CURSOR_NAME_LEN": + return TGetInfoType_CLI_MAX_CURSOR_NAME_LEN, nil + case "CLI_MAX_SCHEMA_NAME_LEN": + return TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN, nil + case "CLI_MAX_CATALOG_NAME_LEN": + return TGetInfoType_CLI_MAX_CATALOG_NAME_LEN, nil + case "CLI_MAX_TABLE_NAME_LEN": + return TGetInfoType_CLI_MAX_TABLE_NAME_LEN, nil + case "CLI_SCROLL_CONCURRENCY": + return TGetInfoType_CLI_SCROLL_CONCURRENCY, nil + case "CLI_TXN_CAPABLE": + return TGetInfoType_CLI_TXN_CAPABLE, nil + case "CLI_USER_NAME": + return TGetInfoType_CLI_USER_NAME, nil + case "CLI_TXN_ISOLATION_OPTION": + return TGetInfoType_CLI_TXN_ISOLATION_OPTION, nil + case "CLI_INTEGRITY": + return TGetInfoType_CLI_INTEGRITY, nil + case "CLI_GETDATA_EXTENSIONS": + return TGetInfoType_CLI_GETDATA_EXTENSIONS, nil + case "CLI_NULL_COLLATION": + return TGetInfoType_CLI_NULL_COLLATION, nil + case "CLI_ALTER_TABLE": + return TGetInfoType_CLI_ALTER_TABLE, nil + case "CLI_ORDER_BY_COLUMNS_IN_SELECT": + return TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT, nil + case "CLI_SPECIAL_CHARACTERS": + return TGetInfoType_CLI_SPECIAL_CHARACTERS, nil + case "CLI_MAX_COLUMNS_IN_GROUP_BY": + return TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY, nil + case "CLI_MAX_COLUMNS_IN_INDEX": + return TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX, nil + case "CLI_MAX_COLUMNS_IN_ORDER_BY": + return TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY, nil + case "CLI_MAX_COLUMNS_IN_SELECT": + return TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT, nil + case "CLI_MAX_COLUMNS_IN_TABLE": + return TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE, nil + case "CLI_MAX_INDEX_SIZE": + return TGetInfoType_CLI_MAX_INDEX_SIZE, nil + case "CLI_MAX_ROW_SIZE": + return TGetInfoType_CLI_MAX_ROW_SIZE, nil + case "CLI_MAX_STATEMENT_LEN": + return TGetInfoType_CLI_MAX_STATEMENT_LEN, nil + case "CLI_MAX_TABLES_IN_SELECT": + return TGetInfoType_CLI_MAX_TABLES_IN_SELECT, nil + case "CLI_MAX_USER_NAME_LEN": + return TGetInfoType_CLI_MAX_USER_NAME_LEN, nil + case "CLI_OJ_CAPABILITIES": + return TGetInfoType_CLI_OJ_CAPABILITIES, nil + case "CLI_XOPEN_CLI_YEAR": + return TGetInfoType_CLI_XOPEN_CLI_YEAR, nil + case "CLI_CURSOR_SENSITIVITY": + return TGetInfoType_CLI_CURSOR_SENSITIVITY, nil + case "CLI_DESCRIBE_PARAMETER": + return TGetInfoType_CLI_DESCRIBE_PARAMETER, nil + case "CLI_CATALOG_NAME": + return TGetInfoType_CLI_CATALOG_NAME, nil + case "CLI_COLLATION_SEQ": + return TGetInfoType_CLI_COLLATION_SEQ, nil + case "CLI_MAX_IDENTIFIER_LEN": + return TGetInfoType_CLI_MAX_IDENTIFIER_LEN, nil + } + return TGetInfoType(0), fmt.Errorf("not a valid TGetInfoType string") } - func TGetInfoTypePtr(v TGetInfoType) *TGetInfoType { return &v } func (p TGetInfoType) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TGetInfoType) UnmarshalText(text []byte) error { -q, err := TGetInfoTypeFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TGetInfoTypeFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TGetInfoType) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TGetInfoType(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TGetInfoType(v) + return nil } -func (p * TGetInfoType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TGetInfoType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TCacheLookupResult_ int64 + const ( - TCacheLookupResult__CACHE_INELIGIBLE TCacheLookupResult_ = 0 - TCacheLookupResult__LOCAL_CACHE_HIT TCacheLookupResult_ = 1 - TCacheLookupResult__REMOTE_CACHE_HIT TCacheLookupResult_ = 2 - TCacheLookupResult__CACHE_MISS TCacheLookupResult_ = 3 + TCacheLookupResult__CACHE_INELIGIBLE TCacheLookupResult_ = 0 + TCacheLookupResult__LOCAL_CACHE_HIT TCacheLookupResult_ = 1 + TCacheLookupResult__REMOTE_CACHE_HIT TCacheLookupResult_ = 2 + TCacheLookupResult__CACHE_MISS TCacheLookupResult_ = 3 ) func (p TCacheLookupResult_) String() string { - switch p { - case TCacheLookupResult__CACHE_INELIGIBLE: return "CACHE_INELIGIBLE" - case TCacheLookupResult__LOCAL_CACHE_HIT: return "LOCAL_CACHE_HIT" - case TCacheLookupResult__REMOTE_CACHE_HIT: return "REMOTE_CACHE_HIT" - case TCacheLookupResult__CACHE_MISS: return "CACHE_MISS" - } - return "" + switch p { + case TCacheLookupResult__CACHE_INELIGIBLE: + return "CACHE_INELIGIBLE" + case TCacheLookupResult__LOCAL_CACHE_HIT: + return "LOCAL_CACHE_HIT" + case TCacheLookupResult__REMOTE_CACHE_HIT: + return "REMOTE_CACHE_HIT" + case TCacheLookupResult__CACHE_MISS: + return "CACHE_MISS" + } + return "" } func TCacheLookupResult_FromString(s string) (TCacheLookupResult_, error) { - switch s { - case "CACHE_INELIGIBLE": return TCacheLookupResult__CACHE_INELIGIBLE, nil - case "LOCAL_CACHE_HIT": return TCacheLookupResult__LOCAL_CACHE_HIT, nil - case "REMOTE_CACHE_HIT": return TCacheLookupResult__REMOTE_CACHE_HIT, nil - case "CACHE_MISS": return TCacheLookupResult__CACHE_MISS, nil - } - return TCacheLookupResult_(0), fmt.Errorf("not a valid TCacheLookupResult_ string") + switch s { + case "CACHE_INELIGIBLE": + return TCacheLookupResult__CACHE_INELIGIBLE, nil + case "LOCAL_CACHE_HIT": + return TCacheLookupResult__LOCAL_CACHE_HIT, nil + case "REMOTE_CACHE_HIT": + return TCacheLookupResult__REMOTE_CACHE_HIT, nil + case "CACHE_MISS": + return TCacheLookupResult__CACHE_MISS, nil + } + return TCacheLookupResult_(0), fmt.Errorf("not a valid TCacheLookupResult_ string") } - func TCacheLookupResult_Ptr(v TCacheLookupResult_) *TCacheLookupResult_ { return &v } func (p TCacheLookupResult_) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TCacheLookupResult_) UnmarshalText(text []byte) error { -q, err := TCacheLookupResult_FromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TCacheLookupResult_FromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TCacheLookupResult_) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TCacheLookupResult_(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TCacheLookupResult_(v) + return nil } -func (p * TCacheLookupResult_) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TCacheLookupResult_) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TFetchOrientation int64 + const ( - TFetchOrientation_FETCH_NEXT TFetchOrientation = 0 - TFetchOrientation_FETCH_PRIOR TFetchOrientation = 1 - TFetchOrientation_FETCH_RELATIVE TFetchOrientation = 2 - TFetchOrientation_FETCH_ABSOLUTE TFetchOrientation = 3 - TFetchOrientation_FETCH_FIRST TFetchOrientation = 4 - TFetchOrientation_FETCH_LAST TFetchOrientation = 5 + TFetchOrientation_FETCH_NEXT TFetchOrientation = 0 + TFetchOrientation_FETCH_PRIOR TFetchOrientation = 1 + TFetchOrientation_FETCH_RELATIVE TFetchOrientation = 2 + TFetchOrientation_FETCH_ABSOLUTE TFetchOrientation = 3 + TFetchOrientation_FETCH_FIRST TFetchOrientation = 4 + TFetchOrientation_FETCH_LAST TFetchOrientation = 5 ) func (p TFetchOrientation) String() string { - switch p { - case TFetchOrientation_FETCH_NEXT: return "FETCH_NEXT" - case TFetchOrientation_FETCH_PRIOR: return "FETCH_PRIOR" - case TFetchOrientation_FETCH_RELATIVE: return "FETCH_RELATIVE" - case TFetchOrientation_FETCH_ABSOLUTE: return "FETCH_ABSOLUTE" - case TFetchOrientation_FETCH_FIRST: return "FETCH_FIRST" - case TFetchOrientation_FETCH_LAST: return "FETCH_LAST" - } - return "" + switch p { + case TFetchOrientation_FETCH_NEXT: + return "FETCH_NEXT" + case TFetchOrientation_FETCH_PRIOR: + return "FETCH_PRIOR" + case TFetchOrientation_FETCH_RELATIVE: + return "FETCH_RELATIVE" + case TFetchOrientation_FETCH_ABSOLUTE: + return "FETCH_ABSOLUTE" + case TFetchOrientation_FETCH_FIRST: + return "FETCH_FIRST" + case TFetchOrientation_FETCH_LAST: + return "FETCH_LAST" + } + return "" } func TFetchOrientationFromString(s string) (TFetchOrientation, error) { - switch s { - case "FETCH_NEXT": return TFetchOrientation_FETCH_NEXT, nil - case "FETCH_PRIOR": return TFetchOrientation_FETCH_PRIOR, nil - case "FETCH_RELATIVE": return TFetchOrientation_FETCH_RELATIVE, nil - case "FETCH_ABSOLUTE": return TFetchOrientation_FETCH_ABSOLUTE, nil - case "FETCH_FIRST": return TFetchOrientation_FETCH_FIRST, nil - case "FETCH_LAST": return TFetchOrientation_FETCH_LAST, nil - } - return TFetchOrientation(0), fmt.Errorf("not a valid TFetchOrientation string") + switch s { + case "FETCH_NEXT": + return TFetchOrientation_FETCH_NEXT, nil + case "FETCH_PRIOR": + return TFetchOrientation_FETCH_PRIOR, nil + case "FETCH_RELATIVE": + return TFetchOrientation_FETCH_RELATIVE, nil + case "FETCH_ABSOLUTE": + return TFetchOrientation_FETCH_ABSOLUTE, nil + case "FETCH_FIRST": + return TFetchOrientation_FETCH_FIRST, nil + case "FETCH_LAST": + return TFetchOrientation_FETCH_LAST, nil + } + return TFetchOrientation(0), fmt.Errorf("not a valid TFetchOrientation string") } - func TFetchOrientationPtr(v TFetchOrientation) *TFetchOrientation { return &v } func (p TFetchOrientation) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TFetchOrientation) UnmarshalText(text []byte) error { -q, err := TFetchOrientationFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TFetchOrientationFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TFetchOrientation) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TFetchOrientation(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TFetchOrientation(v) + return nil } -func (p * TFetchOrientation) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TFetchOrientation) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TJobExecutionStatus int64 + const ( - TJobExecutionStatus_IN_PROGRESS TJobExecutionStatus = 0 - TJobExecutionStatus_COMPLETE TJobExecutionStatus = 1 - TJobExecutionStatus_NOT_AVAILABLE TJobExecutionStatus = 2 + TJobExecutionStatus_IN_PROGRESS TJobExecutionStatus = 0 + TJobExecutionStatus_COMPLETE TJobExecutionStatus = 1 + TJobExecutionStatus_NOT_AVAILABLE TJobExecutionStatus = 2 ) func (p TJobExecutionStatus) String() string { - switch p { - case TJobExecutionStatus_IN_PROGRESS: return "IN_PROGRESS" - case TJobExecutionStatus_COMPLETE: return "COMPLETE" - case TJobExecutionStatus_NOT_AVAILABLE: return "NOT_AVAILABLE" - } - return "" + switch p { + case TJobExecutionStatus_IN_PROGRESS: + return "IN_PROGRESS" + case TJobExecutionStatus_COMPLETE: + return "COMPLETE" + case TJobExecutionStatus_NOT_AVAILABLE: + return "NOT_AVAILABLE" + } + return "" } func TJobExecutionStatusFromString(s string) (TJobExecutionStatus, error) { - switch s { - case "IN_PROGRESS": return TJobExecutionStatus_IN_PROGRESS, nil - case "COMPLETE": return TJobExecutionStatus_COMPLETE, nil - case "NOT_AVAILABLE": return TJobExecutionStatus_NOT_AVAILABLE, nil - } - return TJobExecutionStatus(0), fmt.Errorf("not a valid TJobExecutionStatus string") + switch s { + case "IN_PROGRESS": + return TJobExecutionStatus_IN_PROGRESS, nil + case "COMPLETE": + return TJobExecutionStatus_COMPLETE, nil + case "NOT_AVAILABLE": + return TJobExecutionStatus_NOT_AVAILABLE, nil + } + return TJobExecutionStatus(0), fmt.Errorf("not a valid TJobExecutionStatus string") } - func TJobExecutionStatusPtr(v TJobExecutionStatus) *TJobExecutionStatus { return &v } func (p TJobExecutionStatus) MarshalText() ([]byte, error) { -return []byte(p.String()), nil + return []byte(p.String()), nil } func (p *TJobExecutionStatus) UnmarshalText(text []byte) error { -q, err := TJobExecutionStatusFromString(string(text)) -if (err != nil) { -return err -} -*p = q -return nil + q, err := TJobExecutionStatusFromString(string(text)) + if err != nil { + return err + } + *p = q + return nil } func (p *TJobExecutionStatus) Scan(value interface{}) error { -v, ok := value.(int64) -if !ok { -return errors.New("Scan value is not int64") -} -*p = TJobExecutionStatus(v) -return nil + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = TJobExecutionStatus(v) + return nil } -func (p * TJobExecutionStatus) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } -return int64(*p), nil +func (p *TJobExecutionStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil } + type TTypeEntryPtr int32 func TTypeEntryPtrPtr(v TTypeEntryPtr) *TTypeEntryPtr { return &v } @@ -1015,28476 +1298,31845 @@ type TSparkParameterList []*TSparkParameter func TSparkParameterListPtr(v TSparkParameterList) *TSparkParameterList { return &v } // Attributes: -// - I32Value -// - StringValue +// - I32Value +// - StringValue type TTypeQualifierValue struct { - I32Value *int32 `thrift:"i32Value,1" db:"i32Value" json:"i32Value,omitempty"` - StringValue *string `thrift:"stringValue,2" db:"stringValue" json:"stringValue,omitempty"` + I32Value *int32 `thrift:"i32Value,1" db:"i32Value" json:"i32Value,omitempty"` + StringValue *string `thrift:"stringValue,2" db:"stringValue" json:"stringValue,omitempty"` } func NewTTypeQualifierValue() *TTypeQualifierValue { - return &TTypeQualifierValue{} + return &TTypeQualifierValue{} } var TTypeQualifierValue_I32Value_DEFAULT int32 + func (p *TTypeQualifierValue) GetI32Value() int32 { - if !p.IsSetI32Value() { - return TTypeQualifierValue_I32Value_DEFAULT - } -return *p.I32Value + if !p.IsSetI32Value() { + return TTypeQualifierValue_I32Value_DEFAULT + } + return *p.I32Value } + var TTypeQualifierValue_StringValue_DEFAULT string + func (p *TTypeQualifierValue) GetStringValue() string { - if !p.IsSetStringValue() { - return TTypeQualifierValue_StringValue_DEFAULT - } -return *p.StringValue + if !p.IsSetStringValue() { + return TTypeQualifierValue_StringValue_DEFAULT + } + return *p.StringValue } func (p *TTypeQualifierValue) CountSetFieldsTTypeQualifierValue() int { - count := 0 - if (p.IsSetI32Value()) { - count++ - } - if (p.IsSetStringValue()) { - count++ - } - return count + count := 0 + if p.IsSetI32Value() { + count++ + } + if p.IsSetStringValue() { + count++ + } + return count } func (p *TTypeQualifierValue) IsSetI32Value() bool { - return p.I32Value != nil + return p.I32Value != nil } func (p *TTypeQualifierValue) IsSetStringValue() bool { - return p.StringValue != nil + return p.StringValue != nil } func (p *TTypeQualifierValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TTypeQualifierValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.I32Value = &v -} - return nil -} - -func (p *TTypeQualifierValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.StringValue = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TTypeQualifierValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.I32Value = &v + } + return nil +} + +func (p *TTypeQualifierValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.StringValue = &v + } + return nil } func (p *TTypeQualifierValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTTypeQualifierValue(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TTypeQualifierValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if c := p.CountSetFieldsTTypeQualifierValue(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TTypeQualifierValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TTypeQualifierValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI32Value() { - if err := oprot.WriteFieldBegin(ctx, "i32Value", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:i32Value: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.I32Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.i32Value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:i32Value: ", p), err) } - } - return err + if p.IsSetI32Value() { + if err := oprot.WriteFieldBegin(ctx, "i32Value", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:i32Value: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.I32Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.i32Value (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:i32Value: ", p), err) + } + } + return err } func (p *TTypeQualifierValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringValue() { - if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stringValue: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.stringValue (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stringValue: ", p), err) } - } - return err + if p.IsSetStringValue() { + if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stringValue: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stringValue (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stringValue: ", p), err) + } + } + return err } func (p *TTypeQualifierValue) Equals(other *TTypeQualifierValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.I32Value != other.I32Value { - if p.I32Value == nil || other.I32Value == nil { - return false - } - if (*p.I32Value) != (*other.I32Value) { return false } - } - if p.StringValue != other.StringValue { - if p.StringValue == nil || other.StringValue == nil { - return false - } - if (*p.StringValue) != (*other.StringValue) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.I32Value != other.I32Value { + if p.I32Value == nil || other.I32Value == nil { + return false + } + if (*p.I32Value) != (*other.I32Value) { + return false + } + } + if p.StringValue != other.StringValue { + if p.StringValue == nil || other.StringValue == nil { + return false + } + if (*p.StringValue) != (*other.StringValue) { + return false + } + } + return true } func (p *TTypeQualifierValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTypeQualifierValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTypeQualifierValue(%+v)", *p) } func (p *TTypeQualifierValue) Validate() error { - return nil + return nil } + // Attributes: -// - Qualifiers +// - Qualifiers type TTypeQualifiers struct { - Qualifiers map[string]*TTypeQualifierValue `thrift:"qualifiers,1,required" db:"qualifiers" json:"qualifiers"` + Qualifiers map[string]*TTypeQualifierValue `thrift:"qualifiers,1,required" db:"qualifiers" json:"qualifiers"` } func NewTTypeQualifiers() *TTypeQualifiers { - return &TTypeQualifiers{} + return &TTypeQualifiers{} } - func (p *TTypeQualifiers) GetQualifiers() map[string]*TTypeQualifierValue { - return p.Qualifiers + return p.Qualifiers } func (p *TTypeQualifiers) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetQualifiers bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.MAP { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetQualifiers = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetQualifiers{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Qualifiers is not set")); - } - return nil -} - -func (p *TTypeQualifiers) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]*TTypeQualifierValue, size) - p.Qualifiers = tMap - for i := 0; i < size; i ++ { -var _key0 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key0 = v -} - _val1 := &TTypeQualifierValue{} - if err := _val1.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val1), err) - } - p.Qualifiers[_key0] = _val1 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetQualifiers bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetQualifiers = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetQualifiers { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Qualifiers is not set")) + } + return nil +} + +func (p *TTypeQualifiers) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*TTypeQualifierValue, size) + p.Qualifiers = tMap + for i := 0; i < size; i++ { + var _key0 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key0 = v + } + _val1 := &TTypeQualifierValue{} + if err := _val1.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val1), err) + } + p.Qualifiers[_key0] = _val1 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil } func (p *TTypeQualifiers) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TTypeQualifiers"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TTypeQualifiers"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TTypeQualifiers) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "qualifiers", thrift.MAP, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:qualifiers: ", p), err) } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRUCT, len(p.Qualifiers)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.Qualifiers { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:qualifiers: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "qualifiers", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:qualifiers: ", p), err) + } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRUCT, len(p.Qualifiers)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Qualifiers { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:qualifiers: ", p), err) + } + return err } func (p *TTypeQualifiers) Equals(other *TTypeQualifiers) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Qualifiers) != len(other.Qualifiers) { return false } - for k, _tgt := range p.Qualifiers { - _src2 := other.Qualifiers[k] - if !_tgt.Equals(_src2) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Qualifiers) != len(other.Qualifiers) { + return false + } + for k, _tgt := range p.Qualifiers { + _src2 := other.Qualifiers[k] + if !_tgt.Equals(_src2) { + return false + } + } + return true } func (p *TTypeQualifiers) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTypeQualifiers(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTypeQualifiers(%+v)", *p) } func (p *TTypeQualifiers) Validate() error { - return nil + return nil } + // Attributes: -// - Type -// - TypeQualifiers +// - Type +// - TypeQualifiers type TPrimitiveTypeEntry struct { - Type TTypeId `thrift:"type,1,required" db:"type" json:"type"` - TypeQualifiers *TTypeQualifiers `thrift:"typeQualifiers,2" db:"typeQualifiers" json:"typeQualifiers,omitempty"` + Type TTypeId `thrift:"type,1,required" db:"type" json:"type"` + TypeQualifiers *TTypeQualifiers `thrift:"typeQualifiers,2" db:"typeQualifiers" json:"typeQualifiers,omitempty"` } func NewTPrimitiveTypeEntry() *TPrimitiveTypeEntry { - return &TPrimitiveTypeEntry{} + return &TPrimitiveTypeEntry{} } - func (p *TPrimitiveTypeEntry) GetType() TTypeId { - return p.Type + return p.Type } + var TPrimitiveTypeEntry_TypeQualifiers_DEFAULT *TTypeQualifiers + func (p *TPrimitiveTypeEntry) GetTypeQualifiers() *TTypeQualifiers { - if !p.IsSetTypeQualifiers() { - return TPrimitiveTypeEntry_TypeQualifiers_DEFAULT - } -return p.TypeQualifiers + if !p.IsSetTypeQualifiers() { + return TPrimitiveTypeEntry_TypeQualifiers_DEFAULT + } + return p.TypeQualifiers } func (p *TPrimitiveTypeEntry) IsSetTypeQualifiers() bool { - return p.TypeQualifiers != nil + return p.TypeQualifiers != nil } func (p *TPrimitiveTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetType bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetType = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetType{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")); - } - return nil -} - -func (p *TPrimitiveTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TTypeId(v) - p.Type = temp -} - return nil -} - -func (p *TPrimitiveTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.TypeQualifiers = &TTypeQualifiers{} - if err := p.TypeQualifiers.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeQualifiers), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetType bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetType = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetType { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")) + } + return nil +} + +func (p *TPrimitiveTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := TTypeId(v) + p.Type = temp + } + return nil +} + +func (p *TPrimitiveTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.TypeQualifiers = &TTypeQualifiers{} + if err := p.TypeQualifiers.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeQualifiers), err) + } + return nil } func (p *TPrimitiveTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TPrimitiveTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TPrimitiveTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TPrimitiveTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) + } + return err } func (p *TPrimitiveTypeEntry) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTypeQualifiers() { - if err := oprot.WriteFieldBegin(ctx, "typeQualifiers", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:typeQualifiers: ", p), err) } - if err := p.TypeQualifiers.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeQualifiers), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeQualifiers: ", p), err) } - } - return err + if p.IsSetTypeQualifiers() { + if err := oprot.WriteFieldBegin(ctx, "typeQualifiers", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:typeQualifiers: ", p), err) + } + if err := p.TypeQualifiers.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeQualifiers), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeQualifiers: ", p), err) + } + } + return err } func (p *TPrimitiveTypeEntry) Equals(other *TPrimitiveTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Type != other.Type { return false } - if !p.TypeQualifiers.Equals(other.TypeQualifiers) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Type != other.Type { + return false + } + if !p.TypeQualifiers.Equals(other.TypeQualifiers) { + return false + } + return true } func (p *TPrimitiveTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TPrimitiveTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TPrimitiveTypeEntry(%+v)", *p) } func (p *TPrimitiveTypeEntry) Validate() error { - return nil + return nil } + // Attributes: -// - ObjectTypePtr +// - ObjectTypePtr type TArrayTypeEntry struct { - ObjectTypePtr TTypeEntryPtr `thrift:"objectTypePtr,1,required" db:"objectTypePtr" json:"objectTypePtr"` + ObjectTypePtr TTypeEntryPtr `thrift:"objectTypePtr,1,required" db:"objectTypePtr" json:"objectTypePtr"` } func NewTArrayTypeEntry() *TArrayTypeEntry { - return &TArrayTypeEntry{} + return &TArrayTypeEntry{} } - func (p *TArrayTypeEntry) GetObjectTypePtr() TTypeEntryPtr { - return p.ObjectTypePtr + return p.ObjectTypePtr } func (p *TArrayTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetObjectTypePtr bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetObjectTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetObjectTypePtr{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ObjectTypePtr is not set")); - } - return nil -} - -func (p *TArrayTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TTypeEntryPtr(v) - p.ObjectTypePtr = temp -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetObjectTypePtr bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetObjectTypePtr = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetObjectTypePtr { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ObjectTypePtr is not set")) + } + return nil +} + +func (p *TArrayTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := TTypeEntryPtr(v) + p.ObjectTypePtr = temp + } + return nil } func (p *TArrayTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TArrayTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TArrayTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TArrayTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "objectTypePtr", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:objectTypePtr: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.ObjectTypePtr)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.objectTypePtr (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:objectTypePtr: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "objectTypePtr", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:objectTypePtr: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.ObjectTypePtr)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.objectTypePtr (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:objectTypePtr: ", p), err) + } + return err } func (p *TArrayTypeEntry) Equals(other *TArrayTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.ObjectTypePtr != other.ObjectTypePtr { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ObjectTypePtr != other.ObjectTypePtr { + return false + } + return true } func (p *TArrayTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TArrayTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TArrayTypeEntry(%+v)", *p) } func (p *TArrayTypeEntry) Validate() error { - return nil + return nil } + // Attributes: -// - KeyTypePtr -// - ValueTypePtr +// - KeyTypePtr +// - ValueTypePtr type TMapTypeEntry struct { - KeyTypePtr TTypeEntryPtr `thrift:"keyTypePtr,1,required" db:"keyTypePtr" json:"keyTypePtr"` - ValueTypePtr TTypeEntryPtr `thrift:"valueTypePtr,2,required" db:"valueTypePtr" json:"valueTypePtr"` + KeyTypePtr TTypeEntryPtr `thrift:"keyTypePtr,1,required" db:"keyTypePtr" json:"keyTypePtr"` + ValueTypePtr TTypeEntryPtr `thrift:"valueTypePtr,2,required" db:"valueTypePtr" json:"valueTypePtr"` } func NewTMapTypeEntry() *TMapTypeEntry { - return &TMapTypeEntry{} + return &TMapTypeEntry{} } - func (p *TMapTypeEntry) GetKeyTypePtr() TTypeEntryPtr { - return p.KeyTypePtr + return p.KeyTypePtr } func (p *TMapTypeEntry) GetValueTypePtr() TTypeEntryPtr { - return p.ValueTypePtr + return p.ValueTypePtr } func (p *TMapTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetKeyTypePtr bool = false; - var issetValueTypePtr bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetKeyTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetValueTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetKeyTypePtr{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field KeyTypePtr is not set")); - } - if !issetValueTypePtr{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ValueTypePtr is not set")); - } - return nil -} - -func (p *TMapTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TTypeEntryPtr(v) - p.KeyTypePtr = temp -} - return nil -} - -func (p *TMapTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TTypeEntryPtr(v) - p.ValueTypePtr = temp -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetKeyTypePtr bool = false + var issetValueTypePtr bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetKeyTypePtr = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetValueTypePtr = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetKeyTypePtr { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field KeyTypePtr is not set")) + } + if !issetValueTypePtr { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ValueTypePtr is not set")) + } + return nil +} + +func (p *TMapTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := TTypeEntryPtr(v) + p.KeyTypePtr = temp + } + return nil +} + +func (p *TMapTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TTypeEntryPtr(v) + p.ValueTypePtr = temp + } + return nil } func (p *TMapTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TMapTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TMapTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TMapTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "keyTypePtr", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:keyTypePtr: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.KeyTypePtr)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.keyTypePtr (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:keyTypePtr: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "keyTypePtr", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:keyTypePtr: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.KeyTypePtr)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.keyTypePtr (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:keyTypePtr: ", p), err) + } + return err } func (p *TMapTypeEntry) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "valueTypePtr", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:valueTypePtr: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.ValueTypePtr)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.valueTypePtr (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:valueTypePtr: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "valueTypePtr", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:valueTypePtr: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.ValueTypePtr)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.valueTypePtr (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:valueTypePtr: ", p), err) + } + return err } func (p *TMapTypeEntry) Equals(other *TMapTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.KeyTypePtr != other.KeyTypePtr { return false } - if p.ValueTypePtr != other.ValueTypePtr { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.KeyTypePtr != other.KeyTypePtr { + return false + } + if p.ValueTypePtr != other.ValueTypePtr { + return false + } + return true } func (p *TMapTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TMapTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TMapTypeEntry(%+v)", *p) } func (p *TMapTypeEntry) Validate() error { - return nil + return nil } + // Attributes: -// - NameToTypePtr +// - NameToTypePtr type TStructTypeEntry struct { - NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"` + NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"` } func NewTStructTypeEntry() *TStructTypeEntry { - return &TStructTypeEntry{} + return &TStructTypeEntry{} } - func (p *TStructTypeEntry) GetNameToTypePtr() map[string]TTypeEntryPtr { - return p.NameToTypePtr + return p.NameToTypePtr } func (p *TStructTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetNameToTypePtr bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.MAP { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetNameToTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetNameToTypePtr{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NameToTypePtr is not set")); - } - return nil -} - -func (p *TStructTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]TTypeEntryPtr, size) - p.NameToTypePtr = tMap - for i := 0; i < size; i ++ { -var _key3 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key3 = v -} -var _val4 TTypeEntryPtr - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - temp := TTypeEntryPtr(v) - _val4 = temp -} - p.NameToTypePtr[_key3] = _val4 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetNameToTypePtr bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetNameToTypePtr = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetNameToTypePtr { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NameToTypePtr is not set")) + } + return nil +} + +func (p *TStructTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]TTypeEntryPtr, size) + p.NameToTypePtr = tMap + for i := 0; i < size; i++ { + var _key3 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key3 = v + } + var _val4 TTypeEntryPtr + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := TTypeEntryPtr(v) + _val4 = temp + } + p.NameToTypePtr[_key3] = _val4 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil } func (p *TStructTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStructTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TStructTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TStructTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nameToTypePtr", thrift.MAP, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.NameToTypePtr { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteI32(ctx, int32(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "nameToTypePtr", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) + } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.NameToTypePtr { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) + } + return err } func (p *TStructTypeEntry) Equals(other *TStructTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.NameToTypePtr) != len(other.NameToTypePtr) { return false } - for k, _tgt := range p.NameToTypePtr { - _src5 := other.NameToTypePtr[k] - if _tgt != _src5 { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.NameToTypePtr) != len(other.NameToTypePtr) { + return false + } + for k, _tgt := range p.NameToTypePtr { + _src5 := other.NameToTypePtr[k] + if _tgt != _src5 { + return false + } + } + return true } func (p *TStructTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TStructTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TStructTypeEntry(%+v)", *p) } func (p *TStructTypeEntry) Validate() error { - return nil + return nil } + // Attributes: -// - NameToTypePtr +// - NameToTypePtr type TUnionTypeEntry struct { - NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"` + NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"` } func NewTUnionTypeEntry() *TUnionTypeEntry { - return &TUnionTypeEntry{} + return &TUnionTypeEntry{} } - func (p *TUnionTypeEntry) GetNameToTypePtr() map[string]TTypeEntryPtr { - return p.NameToTypePtr + return p.NameToTypePtr } func (p *TUnionTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetNameToTypePtr bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.MAP { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetNameToTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetNameToTypePtr{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NameToTypePtr is not set")); - } - return nil -} - -func (p *TUnionTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]TTypeEntryPtr, size) - p.NameToTypePtr = tMap - for i := 0; i < size; i ++ { -var _key6 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key6 = v -} -var _val7 TTypeEntryPtr - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - temp := TTypeEntryPtr(v) - _val7 = temp -} - p.NameToTypePtr[_key6] = _val7 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetNameToTypePtr bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetNameToTypePtr = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetNameToTypePtr { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NameToTypePtr is not set")) + } + return nil +} + +func (p *TUnionTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]TTypeEntryPtr, size) + p.NameToTypePtr = tMap + for i := 0; i < size; i++ { + var _key6 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key6 = v + } + var _val7 TTypeEntryPtr + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := TTypeEntryPtr(v) + _val7 = temp + } + p.NameToTypePtr[_key6] = _val7 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil } func (p *TUnionTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TUnionTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TUnionTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TUnionTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nameToTypePtr", thrift.MAP, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.NameToTypePtr { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteI32(ctx, int32(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "nameToTypePtr", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) + } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.NameToTypePtr { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) + } + return err } func (p *TUnionTypeEntry) Equals(other *TUnionTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.NameToTypePtr) != len(other.NameToTypePtr) { return false } - for k, _tgt := range p.NameToTypePtr { - _src8 := other.NameToTypePtr[k] - if _tgt != _src8 { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.NameToTypePtr) != len(other.NameToTypePtr) { + return false + } + for k, _tgt := range p.NameToTypePtr { + _src8 := other.NameToTypePtr[k] + if _tgt != _src8 { + return false + } + } + return true } func (p *TUnionTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TUnionTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TUnionTypeEntry(%+v)", *p) } func (p *TUnionTypeEntry) Validate() error { - return nil + return nil } + // Attributes: -// - TypeClassName +// - TypeClassName type TUserDefinedTypeEntry struct { - TypeClassName string `thrift:"typeClassName,1,required" db:"typeClassName" json:"typeClassName"` + TypeClassName string `thrift:"typeClassName,1,required" db:"typeClassName" json:"typeClassName"` } func NewTUserDefinedTypeEntry() *TUserDefinedTypeEntry { - return &TUserDefinedTypeEntry{} + return &TUserDefinedTypeEntry{} } - func (p *TUserDefinedTypeEntry) GetTypeClassName() string { - return p.TypeClassName + return p.TypeClassName } func (p *TUserDefinedTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetTypeClassName bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetTypeClassName = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetTypeClassName{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TypeClassName is not set")); - } - return nil -} - -func (p *TUserDefinedTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.TypeClassName = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetTypeClassName bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetTypeClassName = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetTypeClassName { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TypeClassName is not set")) + } + return nil +} + +func (p *TUserDefinedTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.TypeClassName = v + } + return nil } func (p *TUserDefinedTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TUserDefinedTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TUserDefinedTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TUserDefinedTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "typeClassName", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:typeClassName: ", p), err) } - if err := oprot.WriteString(ctx, string(p.TypeClassName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.typeClassName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:typeClassName: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "typeClassName", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:typeClassName: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.TypeClassName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.typeClassName (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:typeClassName: ", p), err) + } + return err } func (p *TUserDefinedTypeEntry) Equals(other *TUserDefinedTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.TypeClassName != other.TypeClassName { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.TypeClassName != other.TypeClassName { + return false + } + return true } func (p *TUserDefinedTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TUserDefinedTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TUserDefinedTypeEntry(%+v)", *p) } func (p *TUserDefinedTypeEntry) Validate() error { - return nil + return nil } + // Attributes: -// - PrimitiveEntry -// - ArrayEntry -// - MapEntry -// - StructEntry -// - UnionEntry -// - UserDefinedTypeEntry +// - PrimitiveEntry +// - ArrayEntry +// - MapEntry +// - StructEntry +// - UnionEntry +// - UserDefinedTypeEntry type TTypeEntry struct { - PrimitiveEntry *TPrimitiveTypeEntry `thrift:"primitiveEntry,1" db:"primitiveEntry" json:"primitiveEntry,omitempty"` - ArrayEntry *TArrayTypeEntry `thrift:"arrayEntry,2" db:"arrayEntry" json:"arrayEntry,omitempty"` - MapEntry *TMapTypeEntry `thrift:"mapEntry,3" db:"mapEntry" json:"mapEntry,omitempty"` - StructEntry *TStructTypeEntry `thrift:"structEntry,4" db:"structEntry" json:"structEntry,omitempty"` - UnionEntry *TUnionTypeEntry `thrift:"unionEntry,5" db:"unionEntry" json:"unionEntry,omitempty"` - UserDefinedTypeEntry *TUserDefinedTypeEntry `thrift:"userDefinedTypeEntry,6" db:"userDefinedTypeEntry" json:"userDefinedTypeEntry,omitempty"` + PrimitiveEntry *TPrimitiveTypeEntry `thrift:"primitiveEntry,1" db:"primitiveEntry" json:"primitiveEntry,omitempty"` + ArrayEntry *TArrayTypeEntry `thrift:"arrayEntry,2" db:"arrayEntry" json:"arrayEntry,omitempty"` + MapEntry *TMapTypeEntry `thrift:"mapEntry,3" db:"mapEntry" json:"mapEntry,omitempty"` + StructEntry *TStructTypeEntry `thrift:"structEntry,4" db:"structEntry" json:"structEntry,omitempty"` + UnionEntry *TUnionTypeEntry `thrift:"unionEntry,5" db:"unionEntry" json:"unionEntry,omitempty"` + UserDefinedTypeEntry *TUserDefinedTypeEntry `thrift:"userDefinedTypeEntry,6" db:"userDefinedTypeEntry" json:"userDefinedTypeEntry,omitempty"` } func NewTTypeEntry() *TTypeEntry { - return &TTypeEntry{} + return &TTypeEntry{} } var TTypeEntry_PrimitiveEntry_DEFAULT *TPrimitiveTypeEntry + func (p *TTypeEntry) GetPrimitiveEntry() *TPrimitiveTypeEntry { - if !p.IsSetPrimitiveEntry() { - return TTypeEntry_PrimitiveEntry_DEFAULT - } -return p.PrimitiveEntry + if !p.IsSetPrimitiveEntry() { + return TTypeEntry_PrimitiveEntry_DEFAULT + } + return p.PrimitiveEntry } + var TTypeEntry_ArrayEntry_DEFAULT *TArrayTypeEntry + func (p *TTypeEntry) GetArrayEntry() *TArrayTypeEntry { - if !p.IsSetArrayEntry() { - return TTypeEntry_ArrayEntry_DEFAULT - } -return p.ArrayEntry + if !p.IsSetArrayEntry() { + return TTypeEntry_ArrayEntry_DEFAULT + } + return p.ArrayEntry } + var TTypeEntry_MapEntry_DEFAULT *TMapTypeEntry + func (p *TTypeEntry) GetMapEntry() *TMapTypeEntry { - if !p.IsSetMapEntry() { - return TTypeEntry_MapEntry_DEFAULT - } -return p.MapEntry + if !p.IsSetMapEntry() { + return TTypeEntry_MapEntry_DEFAULT + } + return p.MapEntry } + var TTypeEntry_StructEntry_DEFAULT *TStructTypeEntry + func (p *TTypeEntry) GetStructEntry() *TStructTypeEntry { - if !p.IsSetStructEntry() { - return TTypeEntry_StructEntry_DEFAULT - } -return p.StructEntry + if !p.IsSetStructEntry() { + return TTypeEntry_StructEntry_DEFAULT + } + return p.StructEntry } + var TTypeEntry_UnionEntry_DEFAULT *TUnionTypeEntry + func (p *TTypeEntry) GetUnionEntry() *TUnionTypeEntry { - if !p.IsSetUnionEntry() { - return TTypeEntry_UnionEntry_DEFAULT - } -return p.UnionEntry + if !p.IsSetUnionEntry() { + return TTypeEntry_UnionEntry_DEFAULT + } + return p.UnionEntry } + var TTypeEntry_UserDefinedTypeEntry_DEFAULT *TUserDefinedTypeEntry + func (p *TTypeEntry) GetUserDefinedTypeEntry() *TUserDefinedTypeEntry { - if !p.IsSetUserDefinedTypeEntry() { - return TTypeEntry_UserDefinedTypeEntry_DEFAULT - } -return p.UserDefinedTypeEntry + if !p.IsSetUserDefinedTypeEntry() { + return TTypeEntry_UserDefinedTypeEntry_DEFAULT + } + return p.UserDefinedTypeEntry } func (p *TTypeEntry) CountSetFieldsTTypeEntry() int { - count := 0 - if (p.IsSetPrimitiveEntry()) { - count++ - } - if (p.IsSetArrayEntry()) { - count++ - } - if (p.IsSetMapEntry()) { - count++ - } - if (p.IsSetStructEntry()) { - count++ - } - if (p.IsSetUnionEntry()) { - count++ - } - if (p.IsSetUserDefinedTypeEntry()) { - count++ - } - return count + count := 0 + if p.IsSetPrimitiveEntry() { + count++ + } + if p.IsSetArrayEntry() { + count++ + } + if p.IsSetMapEntry() { + count++ + } + if p.IsSetStructEntry() { + count++ + } + if p.IsSetUnionEntry() { + count++ + } + if p.IsSetUserDefinedTypeEntry() { + count++ + } + return count } func (p *TTypeEntry) IsSetPrimitiveEntry() bool { - return p.PrimitiveEntry != nil + return p.PrimitiveEntry != nil } func (p *TTypeEntry) IsSetArrayEntry() bool { - return p.ArrayEntry != nil + return p.ArrayEntry != nil } func (p *TTypeEntry) IsSetMapEntry() bool { - return p.MapEntry != nil + return p.MapEntry != nil } func (p *TTypeEntry) IsSetStructEntry() bool { - return p.StructEntry != nil + return p.StructEntry != nil } func (p *TTypeEntry) IsSetUnionEntry() bool { - return p.UnionEntry != nil + return p.UnionEntry != nil } func (p *TTypeEntry) IsSetUserDefinedTypeEntry() bool { - return p.UserDefinedTypeEntry != nil + return p.UserDefinedTypeEntry != nil } func (p *TTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.PrimitiveEntry = &TPrimitiveTypeEntry{} - if err := p.PrimitiveEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PrimitiveEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ArrayEntry = &TArrayTypeEntry{} - if err := p.ArrayEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ArrayEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.MapEntry = &TMapTypeEntry{} - if err := p.MapEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MapEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.StructEntry = &TStructTypeEntry{} - if err := p.StructEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StructEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - p.UnionEntry = &TUnionTypeEntry{} - if err := p.UnionEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UnionEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - p.UserDefinedTypeEntry = &TUserDefinedTypeEntry{} - if err := p.UserDefinedTypeEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UserDefinedTypeEntry), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.PrimitiveEntry = &TPrimitiveTypeEntry{} + if err := p.PrimitiveEntry.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PrimitiveEntry), err) + } + return nil +} + +func (p *TTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.ArrayEntry = &TArrayTypeEntry{} + if err := p.ArrayEntry.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ArrayEntry), err) + } + return nil +} + +func (p *TTypeEntry) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.MapEntry = &TMapTypeEntry{} + if err := p.MapEntry.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MapEntry), err) + } + return nil +} + +func (p *TTypeEntry) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.StructEntry = &TStructTypeEntry{} + if err := p.StructEntry.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StructEntry), err) + } + return nil +} + +func (p *TTypeEntry) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + p.UnionEntry = &TUnionTypeEntry{} + if err := p.UnionEntry.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UnionEntry), err) + } + return nil +} + +func (p *TTypeEntry) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + p.UserDefinedTypeEntry = &TUserDefinedTypeEntry{} + if err := p.UserDefinedTypeEntry.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UserDefinedTypeEntry), err) + } + return nil } func (p *TTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTTypeEntry(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if c := p.CountSetFieldsTTypeEntry(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField6(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetPrimitiveEntry() { - if err := oprot.WriteFieldBegin(ctx, "primitiveEntry", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:primitiveEntry: ", p), err) } - if err := p.PrimitiveEntry.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PrimitiveEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:primitiveEntry: ", p), err) } - } - return err + if p.IsSetPrimitiveEntry() { + if err := oprot.WriteFieldBegin(ctx, "primitiveEntry", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:primitiveEntry: ", p), err) + } + if err := p.PrimitiveEntry.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PrimitiveEntry), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:primitiveEntry: ", p), err) + } + } + return err } func (p *TTypeEntry) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArrayEntry() { - if err := oprot.WriteFieldBegin(ctx, "arrayEntry", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:arrayEntry: ", p), err) } - if err := p.ArrayEntry.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ArrayEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:arrayEntry: ", p), err) } - } - return err + if p.IsSetArrayEntry() { + if err := oprot.WriteFieldBegin(ctx, "arrayEntry", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:arrayEntry: ", p), err) + } + if err := p.ArrayEntry.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ArrayEntry), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:arrayEntry: ", p), err) + } + } + return err } func (p *TTypeEntry) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetMapEntry() { - if err := oprot.WriteFieldBegin(ctx, "mapEntry", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:mapEntry: ", p), err) } - if err := p.MapEntry.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MapEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mapEntry: ", p), err) } - } - return err + if p.IsSetMapEntry() { + if err := oprot.WriteFieldBegin(ctx, "mapEntry", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:mapEntry: ", p), err) + } + if err := p.MapEntry.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MapEntry), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mapEntry: ", p), err) + } + } + return err } func (p *TTypeEntry) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStructEntry() { - if err := oprot.WriteFieldBegin(ctx, "structEntry", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:structEntry: ", p), err) } - if err := p.StructEntry.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StructEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:structEntry: ", p), err) } - } - return err + if p.IsSetStructEntry() { + if err := oprot.WriteFieldBegin(ctx, "structEntry", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:structEntry: ", p), err) + } + if err := p.StructEntry.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StructEntry), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:structEntry: ", p), err) + } + } + return err } func (p *TTypeEntry) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetUnionEntry() { - if err := oprot.WriteFieldBegin(ctx, "unionEntry", thrift.STRUCT, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:unionEntry: ", p), err) } - if err := p.UnionEntry.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UnionEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:unionEntry: ", p), err) } - } - return err + if p.IsSetUnionEntry() { + if err := oprot.WriteFieldBegin(ctx, "unionEntry", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:unionEntry: ", p), err) + } + if err := p.UnionEntry.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UnionEntry), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:unionEntry: ", p), err) + } + } + return err } func (p *TTypeEntry) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetUserDefinedTypeEntry() { - if err := oprot.WriteFieldBegin(ctx, "userDefinedTypeEntry", thrift.STRUCT, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:userDefinedTypeEntry: ", p), err) } - if err := p.UserDefinedTypeEntry.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UserDefinedTypeEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:userDefinedTypeEntry: ", p), err) } - } - return err + if p.IsSetUserDefinedTypeEntry() { + if err := oprot.WriteFieldBegin(ctx, "userDefinedTypeEntry", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:userDefinedTypeEntry: ", p), err) + } + if err := p.UserDefinedTypeEntry.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UserDefinedTypeEntry), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:userDefinedTypeEntry: ", p), err) + } + } + return err } func (p *TTypeEntry) Equals(other *TTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.PrimitiveEntry.Equals(other.PrimitiveEntry) { return false } - if !p.ArrayEntry.Equals(other.ArrayEntry) { return false } - if !p.MapEntry.Equals(other.MapEntry) { return false } - if !p.StructEntry.Equals(other.StructEntry) { return false } - if !p.UnionEntry.Equals(other.UnionEntry) { return false } - if !p.UserDefinedTypeEntry.Equals(other.UserDefinedTypeEntry) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.PrimitiveEntry.Equals(other.PrimitiveEntry) { + return false + } + if !p.ArrayEntry.Equals(other.ArrayEntry) { + return false + } + if !p.MapEntry.Equals(other.MapEntry) { + return false + } + if !p.StructEntry.Equals(other.StructEntry) { + return false + } + if !p.UnionEntry.Equals(other.UnionEntry) { + return false + } + if !p.UserDefinedTypeEntry.Equals(other.UserDefinedTypeEntry) { + return false + } + return true } func (p *TTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTypeEntry(%+v)", *p) } func (p *TTypeEntry) Validate() error { - return nil + return nil } + // Attributes: -// - Types +// - Types type TTypeDesc struct { - Types []*TTypeEntry `thrift:"types,1,required" db:"types" json:"types"` + Types []*TTypeEntry `thrift:"types,1,required" db:"types" json:"types"` } func NewTTypeDesc() *TTypeDesc { - return &TTypeDesc{} + return &TTypeDesc{} } - func (p *TTypeDesc) GetTypes() []*TTypeEntry { - return p.Types + return p.Types } func (p *TTypeDesc) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetTypes bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetTypes = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetTypes{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Types is not set")); - } - return nil -} - -func (p *TTypeDesc) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TTypeEntry, 0, size) - p.Types = tSlice - for i := 0; i < size; i ++ { - _elem9 := &TTypeEntry{} - if err := _elem9.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) - } - p.Types = append(p.Types, _elem9) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetTypes bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetTypes = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetTypes { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Types is not set")) + } + return nil +} + +func (p *TTypeDesc) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TTypeEntry, 0, size) + p.Types = tSlice + for i := 0; i < size; i++ { + _elem9 := &TTypeEntry{} + if err := _elem9.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + p.Types = append(p.Types, _elem9) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TTypeDesc) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TTypeDesc"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TTypeDesc"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TTypeDesc) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "types", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:types: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Types)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Types { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:types: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "types", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:types: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Types)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Types { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:types: ", p), err) + } + return err } func (p *TTypeDesc) Equals(other *TTypeDesc) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Types) != len(other.Types) { return false } - for i, _tgt := range p.Types { - _src10 := other.Types[i] - if !_tgt.Equals(_src10) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Types) != len(other.Types) { + return false + } + for i, _tgt := range p.Types { + _src10 := other.Types[i] + if !_tgt.Equals(_src10) { + return false + } + } + return true } func (p *TTypeDesc) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTypeDesc(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTypeDesc(%+v)", *p) } func (p *TTypeDesc) Validate() error { - return nil + return nil } + // Attributes: -// - ColumnName -// - TypeDesc -// - Position -// - Comment +// - ColumnName +// - TypeDesc +// - Position +// - Comment type TColumnDesc struct { - ColumnName string `thrift:"columnName,1,required" db:"columnName" json:"columnName"` - TypeDesc *TTypeDesc `thrift:"typeDesc,2,required" db:"typeDesc" json:"typeDesc"` - Position int32 `thrift:"position,3,required" db:"position" json:"position"` - Comment *string `thrift:"comment,4" db:"comment" json:"comment,omitempty"` + ColumnName string `thrift:"columnName,1,required" db:"columnName" json:"columnName"` + TypeDesc *TTypeDesc `thrift:"typeDesc,2,required" db:"typeDesc" json:"typeDesc"` + Position int32 `thrift:"position,3,required" db:"position" json:"position"` + Comment *string `thrift:"comment,4" db:"comment" json:"comment,omitempty"` } func NewTColumnDesc() *TColumnDesc { - return &TColumnDesc{} + return &TColumnDesc{} } - func (p *TColumnDesc) GetColumnName() string { - return p.ColumnName + return p.ColumnName } + var TColumnDesc_TypeDesc_DEFAULT *TTypeDesc + func (p *TColumnDesc) GetTypeDesc() *TTypeDesc { - if !p.IsSetTypeDesc() { - return TColumnDesc_TypeDesc_DEFAULT - } -return p.TypeDesc + if !p.IsSetTypeDesc() { + return TColumnDesc_TypeDesc_DEFAULT + } + return p.TypeDesc } func (p *TColumnDesc) GetPosition() int32 { - return p.Position + return p.Position } + var TColumnDesc_Comment_DEFAULT string + func (p *TColumnDesc) GetComment() string { - if !p.IsSetComment() { - return TColumnDesc_Comment_DEFAULT - } -return *p.Comment + if !p.IsSetComment() { + return TColumnDesc_Comment_DEFAULT + } + return *p.Comment } func (p *TColumnDesc) IsSetTypeDesc() bool { - return p.TypeDesc != nil + return p.TypeDesc != nil } func (p *TColumnDesc) IsSetComment() bool { - return p.Comment != nil + return p.Comment != nil } func (p *TColumnDesc) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetColumnName bool = false; - var issetTypeDesc bool = false; - var issetPosition bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetColumnName = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetTypeDesc = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I32 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetPosition = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetColumnName{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ColumnName is not set")); - } - if !issetTypeDesc{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TypeDesc is not set")); - } - if !issetPosition{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Position is not set")); - } - return nil -} - -func (p *TColumnDesc) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.ColumnName = v -} - return nil -} - -func (p *TColumnDesc) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.TypeDesc = &TTypeDesc{} - if err := p.TypeDesc.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeDesc), err) - } - return nil -} - -func (p *TColumnDesc) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.Position = v -} - return nil -} - -func (p *TColumnDesc) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.Comment = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetColumnName bool = false + var issetTypeDesc bool = false + var issetPosition bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetColumnName = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetTypeDesc = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetPosition = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetColumnName { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ColumnName is not set")) + } + if !issetTypeDesc { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TypeDesc is not set")) + } + if !issetPosition { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Position is not set")) + } + return nil +} + +func (p *TColumnDesc) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.ColumnName = v + } + return nil +} + +func (p *TColumnDesc) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.TypeDesc = &TTypeDesc{} + if err := p.TypeDesc.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeDesc), err) + } + return nil +} + +func (p *TColumnDesc) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Position = v + } + return nil +} + +func (p *TColumnDesc) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Comment = &v + } + return nil } func (p *TColumnDesc) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TColumnDesc"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TColumnDesc"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TColumnDesc) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "columnName", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columnName: ", p), err) } - if err := oprot.WriteString(ctx, string(p.ColumnName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.columnName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columnName: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "columnName", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columnName: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.ColumnName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.columnName (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columnName: ", p), err) + } + return err } func (p *TColumnDesc) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "typeDesc", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:typeDesc: ", p), err) } - if err := p.TypeDesc.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeDesc), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeDesc: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "typeDesc", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:typeDesc: ", p), err) + } + if err := p.TypeDesc.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeDesc), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeDesc: ", p), err) + } + return err } func (p *TColumnDesc) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "position", thrift.I32, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:position: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.Position)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.position (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:position: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "position", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:position: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.Position)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.position (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:position: ", p), err) + } + return err } func (p *TColumnDesc) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetComment() { - if err := oprot.WriteFieldBegin(ctx, "comment", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:comment: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.Comment)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.comment (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:comment: ", p), err) } - } - return err + if p.IsSetComment() { + if err := oprot.WriteFieldBegin(ctx, "comment", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:comment: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.Comment)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:comment: ", p), err) + } + } + return err } func (p *TColumnDesc) Equals(other *TColumnDesc) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.ColumnName != other.ColumnName { return false } - if !p.TypeDesc.Equals(other.TypeDesc) { return false } - if p.Position != other.Position { return false } - if p.Comment != other.Comment { - if p.Comment == nil || other.Comment == nil { - return false - } - if (*p.Comment) != (*other.Comment) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ColumnName != other.ColumnName { + return false + } + if !p.TypeDesc.Equals(other.TypeDesc) { + return false + } + if p.Position != other.Position { + return false + } + if p.Comment != other.Comment { + if p.Comment == nil || other.Comment == nil { + return false + } + if (*p.Comment) != (*other.Comment) { + return false + } + } + return true } func (p *TColumnDesc) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TColumnDesc(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TColumnDesc(%+v)", *p) } func (p *TColumnDesc) Validate() error { - return nil + return nil } + // Attributes: -// - Columns +// - Columns type TTableSchema struct { - Columns []*TColumnDesc `thrift:"columns,1,required" db:"columns" json:"columns"` + Columns []*TColumnDesc `thrift:"columns,1,required" db:"columns" json:"columns"` } func NewTTableSchema() *TTableSchema { - return &TTableSchema{} + return &TTableSchema{} } - func (p *TTableSchema) GetColumns() []*TColumnDesc { - return p.Columns + return p.Columns } func (p *TTableSchema) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetColumns bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetColumns = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetColumns{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Columns is not set")); - } - return nil -} - -func (p *TTableSchema) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TColumnDesc, 0, size) - p.Columns = tSlice - for i := 0; i < size; i ++ { - _elem11 := &TColumnDesc{} - if err := _elem11.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) - } - p.Columns = append(p.Columns, _elem11) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetColumns bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetColumns = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetColumns { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Columns is not set")) + } + return nil +} + +func (p *TTableSchema) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TColumnDesc, 0, size) + p.Columns = tSlice + for i := 0; i < size; i++ { + _elem11 := &TColumnDesc{} + if err := _elem11.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + } + p.Columns = append(p.Columns, _elem11) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TTableSchema) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TTableSchema"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TTableSchema"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TTableSchema) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columns: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Columns)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Columns { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columns: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columns: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Columns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Columns { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columns: ", p), err) + } + return err } func (p *TTableSchema) Equals(other *TTableSchema) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Columns) != len(other.Columns) { return false } - for i, _tgt := range p.Columns { - _src12 := other.Columns[i] - if !_tgt.Equals(_src12) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Columns) != len(other.Columns) { + return false + } + for i, _tgt := range p.Columns { + _src12 := other.Columns[i] + if !_tgt.Equals(_src12) { + return false + } + } + return true } func (p *TTableSchema) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTableSchema(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTableSchema(%+v)", *p) } func (p *TTableSchema) Validate() error { - return nil + return nil } + // Attributes: -// - Value +// - Value type TBoolValue struct { - Value *bool `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *bool `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTBoolValue() *TBoolValue { - return &TBoolValue{} + return &TBoolValue{} } var TBoolValue_Value_DEFAULT bool + func (p *TBoolValue) GetValue() bool { - if !p.IsSetValue() { - return TBoolValue_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TBoolValue_Value_DEFAULT + } + return *p.Value } func (p *TBoolValue) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TBoolValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TBoolValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Value = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TBoolValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Value = &v + } + return nil } func (p *TBoolValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TBoolValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TBoolValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TBoolValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.BOOL, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) + } + } + return err } func (p *TBoolValue) Equals(other *TBoolValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { + return false + } + } + return true } func (p *TBoolValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TBoolValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TBoolValue(%+v)", *p) } func (p *TBoolValue) Validate() error { - return nil + return nil } + // Attributes: -// - Value +// - Value type TByteValue struct { - Value *int8 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *int8 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTByteValue() *TByteValue { - return &TByteValue{} + return &TByteValue{} } var TByteValue_Value_DEFAULT int8 + func (p *TByteValue) GetValue() int8 { - if !p.IsSetValue() { - return TByteValue_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TByteValue_Value_DEFAULT + } + return *p.Value } func (p *TByteValue) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TByteValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.BYTE { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TByteValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadByte(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := int8(v) - p.Value = &temp -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.BYTE { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TByteValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := int8(v) + p.Value = &temp + } + return nil } func (p *TByteValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TByteValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TByteValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TByteValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.BYTE, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteByte(ctx, int8(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.BYTE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) + } + if err := oprot.WriteByte(ctx, int8(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) + } + } + return err } func (p *TByteValue) Equals(other *TByteValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { + return false + } + } + return true } func (p *TByteValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TByteValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TByteValue(%+v)", *p) } func (p *TByteValue) Validate() error { - return nil + return nil } + // Attributes: -// - Value +// - Value type TI16Value struct { - Value *int16 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *int16 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTI16Value() *TI16Value { - return &TI16Value{} + return &TI16Value{} } var TI16Value_Value_DEFAULT int16 + func (p *TI16Value) GetValue() int16 { - if !p.IsSetValue() { - return TI16Value_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TI16Value_Value_DEFAULT + } + return *p.Value } func (p *TI16Value) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TI16Value) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I16 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TI16Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Value = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I16 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TI16Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Value = &v + } + return nil } func (p *TI16Value) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI16Value"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TI16Value"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TI16Value) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.I16, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteI16(ctx, int16(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.I16, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) + } + if err := oprot.WriteI16(ctx, int16(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) + } + } + return err } func (p *TI16Value) Equals(other *TI16Value) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { + return false + } + } + return true } func (p *TI16Value) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TI16Value(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI16Value(%+v)", *p) } func (p *TI16Value) Validate() error { - return nil + return nil } + // Attributes: -// - Value +// - Value type TI32Value struct { - Value *int32 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *int32 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTI32Value() *TI32Value { - return &TI32Value{} + return &TI32Value{} } var TI32Value_Value_DEFAULT int32 + func (p *TI32Value) GetValue() int32 { - if !p.IsSetValue() { - return TI32Value_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TI32Value_Value_DEFAULT + } + return *p.Value } func (p *TI32Value) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TI32Value) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TI32Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Value = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TI32Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Value = &v + } + return nil } func (p *TI32Value) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI32Value"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TI32Value"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TI32Value) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) + } + } + return err } func (p *TI32Value) Equals(other *TI32Value) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { + return false + } + } + return true } func (p *TI32Value) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TI32Value(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI32Value(%+v)", *p) } func (p *TI32Value) Validate() error { - return nil + return nil } + // Attributes: -// - Value +// - Value type TI64Value struct { - Value *int64 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *int64 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTI64Value() *TI64Value { - return &TI64Value{} + return &TI64Value{} } var TI64Value_Value_DEFAULT int64 + func (p *TI64Value) GetValue() int64 { - if !p.IsSetValue() { - return TI64Value_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TI64Value_Value_DEFAULT + } + return *p.Value } func (p *TI64Value) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TI64Value) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TI64Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Value = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TI64Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Value = &v + } + return nil } func (p *TI64Value) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI64Value"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TI64Value"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TI64Value) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) + } + } + return err } func (p *TI64Value) Equals(other *TI64Value) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { + return false + } + } + return true } func (p *TI64Value) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TI64Value(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI64Value(%+v)", *p) } func (p *TI64Value) Validate() error { - return nil + return nil } + // Attributes: -// - Value +// - Value type TDoubleValue struct { - Value *float64 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *float64 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTDoubleValue() *TDoubleValue { - return &TDoubleValue{} + return &TDoubleValue{} } var TDoubleValue_Value_DEFAULT float64 + func (p *TDoubleValue) GetValue() float64 { - if !p.IsSetValue() { - return TDoubleValue_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TDoubleValue_Value_DEFAULT + } + return *p.Value } func (p *TDoubleValue) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TDoubleValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TDoubleValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Value = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TDoubleValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Value = &v + } + return nil } func (p *TDoubleValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TDoubleValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TDoubleValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TDoubleValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.DOUBLE, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.DOUBLE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) + } + if err := oprot.WriteDouble(ctx, float64(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) + } + } + return err } func (p *TDoubleValue) Equals(other *TDoubleValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { + return false + } + } + return true } func (p *TDoubleValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDoubleValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TDoubleValue(%+v)", *p) } func (p *TDoubleValue) Validate() error { - return nil + return nil } + // Attributes: -// - Value +// - Value type TStringValue struct { - Value *string `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *string `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTStringValue() *TStringValue { - return &TStringValue{} + return &TStringValue{} } var TStringValue_Value_DEFAULT string + func (p *TStringValue) GetValue() string { - if !p.IsSetValue() { - return TStringValue_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TStringValue_Value_DEFAULT + } + return *p.Value } func (p *TStringValue) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TStringValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TStringValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Value = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TStringValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Value = &v + } + return nil } func (p *TStringValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStringValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TStringValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TStringValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) + } + } + return err } func (p *TStringValue) Equals(other *TStringValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { + return false + } + } + return true } func (p *TStringValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TStringValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TStringValue(%+v)", *p) } func (p *TStringValue) Validate() error { - return nil + return nil } + // Attributes: -// - BoolVal -// - ByteVal -// - I16Val -// - I32Val -// - I64Val -// - DoubleVal -// - StringVal +// - BoolVal +// - ByteVal +// - I16Val +// - I32Val +// - I64Val +// - DoubleVal +// - StringVal type TColumnValue struct { - BoolVal *TBoolValue `thrift:"boolVal,1" db:"boolVal" json:"boolVal,omitempty"` - ByteVal *TByteValue `thrift:"byteVal,2" db:"byteVal" json:"byteVal,omitempty"` - I16Val *TI16Value `thrift:"i16Val,3" db:"i16Val" json:"i16Val,omitempty"` - I32Val *TI32Value `thrift:"i32Val,4" db:"i32Val" json:"i32Val,omitempty"` - I64Val *TI64Value `thrift:"i64Val,5" db:"i64Val" json:"i64Val,omitempty"` - DoubleVal *TDoubleValue `thrift:"doubleVal,6" db:"doubleVal" json:"doubleVal,omitempty"` - StringVal *TStringValue `thrift:"stringVal,7" db:"stringVal" json:"stringVal,omitempty"` + BoolVal *TBoolValue `thrift:"boolVal,1" db:"boolVal" json:"boolVal,omitempty"` + ByteVal *TByteValue `thrift:"byteVal,2" db:"byteVal" json:"byteVal,omitempty"` + I16Val *TI16Value `thrift:"i16Val,3" db:"i16Val" json:"i16Val,omitempty"` + I32Val *TI32Value `thrift:"i32Val,4" db:"i32Val" json:"i32Val,omitempty"` + I64Val *TI64Value `thrift:"i64Val,5" db:"i64Val" json:"i64Val,omitempty"` + DoubleVal *TDoubleValue `thrift:"doubleVal,6" db:"doubleVal" json:"doubleVal,omitempty"` + StringVal *TStringValue `thrift:"stringVal,7" db:"stringVal" json:"stringVal,omitempty"` } func NewTColumnValue() *TColumnValue { - return &TColumnValue{} + return &TColumnValue{} } var TColumnValue_BoolVal_DEFAULT *TBoolValue + func (p *TColumnValue) GetBoolVal() *TBoolValue { - if !p.IsSetBoolVal() { - return TColumnValue_BoolVal_DEFAULT - } -return p.BoolVal + if !p.IsSetBoolVal() { + return TColumnValue_BoolVal_DEFAULT + } + return p.BoolVal } + var TColumnValue_ByteVal_DEFAULT *TByteValue + func (p *TColumnValue) GetByteVal() *TByteValue { - if !p.IsSetByteVal() { - return TColumnValue_ByteVal_DEFAULT - } -return p.ByteVal + if !p.IsSetByteVal() { + return TColumnValue_ByteVal_DEFAULT + } + return p.ByteVal } + var TColumnValue_I16Val_DEFAULT *TI16Value + func (p *TColumnValue) GetI16Val() *TI16Value { - if !p.IsSetI16Val() { - return TColumnValue_I16Val_DEFAULT - } -return p.I16Val + if !p.IsSetI16Val() { + return TColumnValue_I16Val_DEFAULT + } + return p.I16Val } + var TColumnValue_I32Val_DEFAULT *TI32Value + func (p *TColumnValue) GetI32Val() *TI32Value { - if !p.IsSetI32Val() { - return TColumnValue_I32Val_DEFAULT - } -return p.I32Val + if !p.IsSetI32Val() { + return TColumnValue_I32Val_DEFAULT + } + return p.I32Val } + var TColumnValue_I64Val_DEFAULT *TI64Value + func (p *TColumnValue) GetI64Val() *TI64Value { - if !p.IsSetI64Val() { - return TColumnValue_I64Val_DEFAULT - } -return p.I64Val + if !p.IsSetI64Val() { + return TColumnValue_I64Val_DEFAULT + } + return p.I64Val } + var TColumnValue_DoubleVal_DEFAULT *TDoubleValue + func (p *TColumnValue) GetDoubleVal() *TDoubleValue { - if !p.IsSetDoubleVal() { - return TColumnValue_DoubleVal_DEFAULT - } -return p.DoubleVal + if !p.IsSetDoubleVal() { + return TColumnValue_DoubleVal_DEFAULT + } + return p.DoubleVal } + var TColumnValue_StringVal_DEFAULT *TStringValue + func (p *TColumnValue) GetStringVal() *TStringValue { - if !p.IsSetStringVal() { - return TColumnValue_StringVal_DEFAULT - } -return p.StringVal + if !p.IsSetStringVal() { + return TColumnValue_StringVal_DEFAULT + } + return p.StringVal } func (p *TColumnValue) CountSetFieldsTColumnValue() int { - count := 0 - if (p.IsSetBoolVal()) { - count++ - } - if (p.IsSetByteVal()) { - count++ - } - if (p.IsSetI16Val()) { - count++ - } - if (p.IsSetI32Val()) { - count++ - } - if (p.IsSetI64Val()) { - count++ - } - if (p.IsSetDoubleVal()) { - count++ - } - if (p.IsSetStringVal()) { - count++ - } - return count + count := 0 + if p.IsSetBoolVal() { + count++ + } + if p.IsSetByteVal() { + count++ + } + if p.IsSetI16Val() { + count++ + } + if p.IsSetI32Val() { + count++ + } + if p.IsSetI64Val() { + count++ + } + if p.IsSetDoubleVal() { + count++ + } + if p.IsSetStringVal() { + count++ + } + return count } func (p *TColumnValue) IsSetBoolVal() bool { - return p.BoolVal != nil + return p.BoolVal != nil } func (p *TColumnValue) IsSetByteVal() bool { - return p.ByteVal != nil + return p.ByteVal != nil } func (p *TColumnValue) IsSetI16Val() bool { - return p.I16Val != nil + return p.I16Val != nil } func (p *TColumnValue) IsSetI32Val() bool { - return p.I32Val != nil + return p.I32Val != nil } func (p *TColumnValue) IsSetI64Val() bool { - return p.I64Val != nil + return p.I64Val != nil } func (p *TColumnValue) IsSetDoubleVal() bool { - return p.DoubleVal != nil + return p.DoubleVal != nil } func (p *TColumnValue) IsSetStringVal() bool { - return p.StringVal != nil + return p.StringVal != nil } func (p *TColumnValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TColumnValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.BoolVal = &TBoolValue{} - if err := p.BoolVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err) - } - return nil -} - -func (p *TColumnValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ByteVal = &TByteValue{} - if err := p.ByteVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err) - } - return nil -} - -func (p *TColumnValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.I16Val = &TI16Value{} - if err := p.I16Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err) - } - return nil -} - -func (p *TColumnValue) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.I32Val = &TI32Value{} - if err := p.I32Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err) - } - return nil -} - -func (p *TColumnValue) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - p.I64Val = &TI64Value{} - if err := p.I64Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err) - } - return nil -} - -func (p *TColumnValue) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - p.DoubleVal = &TDoubleValue{} - if err := p.DoubleVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err) - } - return nil -} - -func (p *TColumnValue) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - p.StringVal = &TStringValue{} - if err := p.StringVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TColumnValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.BoolVal = &TBoolValue{} + if err := p.BoolVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err) + } + return nil +} + +func (p *TColumnValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.ByteVal = &TByteValue{} + if err := p.ByteVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err) + } + return nil +} + +func (p *TColumnValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.I16Val = &TI16Value{} + if err := p.I16Val.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err) + } + return nil +} + +func (p *TColumnValue) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.I32Val = &TI32Value{} + if err := p.I32Val.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err) + } + return nil +} + +func (p *TColumnValue) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + p.I64Val = &TI64Value{} + if err := p.I64Val.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err) + } + return nil +} + +func (p *TColumnValue) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + p.DoubleVal = &TDoubleValue{} + if err := p.DoubleVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err) + } + return nil +} + +func (p *TColumnValue) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + p.StringVal = &TStringValue{} + if err := p.StringVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err) + } + return nil } func (p *TColumnValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTColumnValue(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TColumnValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - if err := p.writeField7(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if c := p.CountSetFieldsTColumnValue(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TColumnValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField6(ctx, oprot); err != nil { + return err + } + if err := p.writeField7(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TColumnValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBoolVal() { - if err := oprot.WriteFieldBegin(ctx, "boolVal", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:boolVal: ", p), err) } - if err := p.BoolVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) } - } - return err + if p.IsSetBoolVal() { + if err := oprot.WriteFieldBegin(ctx, "boolVal", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:boolVal: ", p), err) + } + if err := p.BoolVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) + } + } + return err } func (p *TColumnValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetByteVal() { - if err := oprot.WriteFieldBegin(ctx, "byteVal", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:byteVal: ", p), err) } - if err := p.ByteVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) } - } - return err + if p.IsSetByteVal() { + if err := oprot.WriteFieldBegin(ctx, "byteVal", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:byteVal: ", p), err) + } + if err := p.ByteVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) + } + } + return err } func (p *TColumnValue) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI16Val() { - if err := oprot.WriteFieldBegin(ctx, "i16Val", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i16Val: ", p), err) } - if err := p.I16Val.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) } - } - return err + if p.IsSetI16Val() { + if err := oprot.WriteFieldBegin(ctx, "i16Val", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i16Val: ", p), err) + } + if err := p.I16Val.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) + } + } + return err } func (p *TColumnValue) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI32Val() { - if err := oprot.WriteFieldBegin(ctx, "i32Val", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:i32Val: ", p), err) } - if err := p.I32Val.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) } - } - return err + if p.IsSetI32Val() { + if err := oprot.WriteFieldBegin(ctx, "i32Val", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:i32Val: ", p), err) + } + if err := p.I32Val.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) + } + } + return err } func (p *TColumnValue) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI64Val() { - if err := oprot.WriteFieldBegin(ctx, "i64Val", thrift.STRUCT, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:i64Val: ", p), err) } - if err := p.I64Val.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) } - } - return err + if p.IsSetI64Val() { + if err := oprot.WriteFieldBegin(ctx, "i64Val", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:i64Val: ", p), err) + } + if err := p.I64Val.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) + } + } + return err } func (p *TColumnValue) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDoubleVal() { - if err := oprot.WriteFieldBegin(ctx, "doubleVal", thrift.STRUCT, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:doubleVal: ", p), err) } - if err := p.DoubleVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) } - } - return err + if p.IsSetDoubleVal() { + if err := oprot.WriteFieldBegin(ctx, "doubleVal", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:doubleVal: ", p), err) + } + if err := p.DoubleVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) + } + } + return err } func (p *TColumnValue) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringVal() { - if err := oprot.WriteFieldBegin(ctx, "stringVal", thrift.STRUCT, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stringVal: ", p), err) } - if err := p.StringVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) } - } - return err + if p.IsSetStringVal() { + if err := oprot.WriteFieldBegin(ctx, "stringVal", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stringVal: ", p), err) + } + if err := p.StringVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) + } + } + return err } func (p *TColumnValue) Equals(other *TColumnValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.BoolVal.Equals(other.BoolVal) { return false } - if !p.ByteVal.Equals(other.ByteVal) { return false } - if !p.I16Val.Equals(other.I16Val) { return false } - if !p.I32Val.Equals(other.I32Val) { return false } - if !p.I64Val.Equals(other.I64Val) { return false } - if !p.DoubleVal.Equals(other.DoubleVal) { return false } - if !p.StringVal.Equals(other.StringVal) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.BoolVal.Equals(other.BoolVal) { + return false + } + if !p.ByteVal.Equals(other.ByteVal) { + return false + } + if !p.I16Val.Equals(other.I16Val) { + return false + } + if !p.I32Val.Equals(other.I32Val) { + return false + } + if !p.I64Val.Equals(other.I64Val) { + return false + } + if !p.DoubleVal.Equals(other.DoubleVal) { + return false + } + if !p.StringVal.Equals(other.StringVal) { + return false + } + return true } func (p *TColumnValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TColumnValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TColumnValue(%+v)", *p) } func (p *TColumnValue) Validate() error { - return nil + return nil } + // Attributes: -// - ColVals +// - ColVals type TRow struct { - ColVals []*TColumnValue `thrift:"colVals,1,required" db:"colVals" json:"colVals"` + ColVals []*TColumnValue `thrift:"colVals,1,required" db:"colVals" json:"colVals"` } func NewTRow() *TRow { - return &TRow{} + return &TRow{} } - func (p *TRow) GetColVals() []*TColumnValue { - return p.ColVals + return p.ColVals } func (p *TRow) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetColVals bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetColVals = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetColVals{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ColVals is not set")); - } - return nil -} - -func (p *TRow) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TColumnValue, 0, size) - p.ColVals = tSlice - for i := 0; i < size; i ++ { - _elem13 := &TColumnValue{} - if err := _elem13.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) - } - p.ColVals = append(p.ColVals, _elem13) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetColVals bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetColVals = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetColVals { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ColVals is not set")) + } + return nil +} + +func (p *TRow) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TColumnValue, 0, size) + p.ColVals = tSlice + for i := 0; i < size; i++ { + _elem13 := &TColumnValue{} + if err := _elem13.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) + } + p.ColVals = append(p.ColVals, _elem13) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TRow) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TRow"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TRow"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TRow) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "colVals", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:colVals: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ColVals)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.ColVals { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:colVals: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "colVals", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:colVals: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ColVals)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ColVals { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:colVals: ", p), err) + } + return err } func (p *TRow) Equals(other *TRow) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.ColVals) != len(other.ColVals) { return false } - for i, _tgt := range p.ColVals { - _src14 := other.ColVals[i] - if !_tgt.Equals(_src14) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.ColVals) != len(other.ColVals) { + return false + } + for i, _tgt := range p.ColVals { + _src14 := other.ColVals[i] + if !_tgt.Equals(_src14) { + return false + } + } + return true } func (p *TRow) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TRow(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TRow(%+v)", *p) } func (p *TRow) Validate() error { - return nil + return nil } + // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TBoolColumn struct { - Values []bool `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []bool `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTBoolColumn() *TBoolColumn { - return &TBoolColumn{} + return &TBoolColumn{} } - func (p *TBoolColumn) GetValues() []bool { - return p.Values + return p.Values } func (p *TBoolColumn) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TBoolColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false; - var issetNulls bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); - } - if !issetNulls{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); - } - return nil -} - -func (p *TBoolColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]bool, 0, size) - p.Values = tSlice - for i := 0; i < size; i ++ { -var _elem15 bool - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem15 = v -} - p.Values = append(p.Values, _elem15) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TBoolColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false + var issetNulls bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) + } + if !issetNulls { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) + } + return nil +} + +func (p *TBoolColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]bool, 0, size) + p.Values = tSlice + for i := 0; i < size; i++ { + var _elem15 bool + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem15 = v + } + p.Values = append(p.Values, _elem15) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TBoolColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Nulls = v + } + return nil } func (p *TBoolColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TBoolColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TBoolColumn"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TBoolColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteBool(ctx, bool(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteBool(ctx, bool(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) + } + return err } func (p *TBoolColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) + } + return err } func (p *TBoolColumn) Equals(other *TBoolColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src16 := other.Values[i] - if _tgt != _src16 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { + return false + } + for i, _tgt := range p.Values { + _src16 := other.Values[i] + if _tgt != _src16 { + return false + } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { + return false + } + return true } func (p *TBoolColumn) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TBoolColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TBoolColumn(%+v)", *p) } func (p *TBoolColumn) Validate() error { - return nil + return nil } + // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TByteColumn struct { - Values []int8 `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []int8 `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTByteColumn() *TByteColumn { - return &TByteColumn{} + return &TByteColumn{} } - func (p *TByteColumn) GetValues() []int8 { - return p.Values + return p.Values } func (p *TByteColumn) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TByteColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false; - var issetNulls bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); - } - if !issetNulls{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); - } - return nil -} - -func (p *TByteColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]int8, 0, size) - p.Values = tSlice - for i := 0; i < size; i ++ { -var _elem17 int8 - if v, err := iprot.ReadByte(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - temp := int8(v) - _elem17 = temp -} - p.Values = append(p.Values, _elem17) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TByteColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false + var issetNulls bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) + } + if !issetNulls { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) + } + return nil +} + +func (p *TByteColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int8, 0, size) + p.Values = tSlice + for i := 0; i < size; i++ { + var _elem17 int8 + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := int8(v) + _elem17 = temp + } + p.Values = append(p.Values, _elem17) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TByteColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Nulls = v + } + return nil } func (p *TByteColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TByteColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TByteColumn"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TByteColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.BYTE, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteByte(ctx, int8(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.BYTE, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteByte(ctx, int8(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) + } + return err } func (p *TByteColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) + } + return err } func (p *TByteColumn) Equals(other *TByteColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src18 := other.Values[i] - if _tgt != _src18 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { + return false + } + for i, _tgt := range p.Values { + _src18 := other.Values[i] + if _tgt != _src18 { + return false + } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { + return false + } + return true } func (p *TByteColumn) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TByteColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TByteColumn(%+v)", *p) } func (p *TByteColumn) Validate() error { - return nil + return nil } + // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TI16Column struct { - Values []int16 `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []int16 `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTI16Column() *TI16Column { - return &TI16Column{} + return &TI16Column{} } - func (p *TI16Column) GetValues() []int16 { - return p.Values + return p.Values } func (p *TI16Column) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TI16Column) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false; - var issetNulls bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); - } - if !issetNulls{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); - } - return nil -} - -func (p *TI16Column) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]int16, 0, size) - p.Values = tSlice - for i := 0; i < size; i ++ { -var _elem19 int16 - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem19 = v -} - p.Values = append(p.Values, _elem19) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TI16Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false + var issetNulls bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) + } + if !issetNulls { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) + } + return nil +} + +func (p *TI16Column) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int16, 0, size) + p.Values = tSlice + for i := 0; i < size; i++ { + var _elem19 int16 + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem19 = v + } + p.Values = append(p.Values, _elem19) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TI16Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Nulls = v + } + return nil } func (p *TI16Column) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI16Column"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TI16Column"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TI16Column) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.I16, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteI16(ctx, int16(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.I16, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteI16(ctx, int16(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) + } + return err } func (p *TI16Column) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) + } + return err } func (p *TI16Column) Equals(other *TI16Column) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src20 := other.Values[i] - if _tgt != _src20 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { + return false + } + for i, _tgt := range p.Values { + _src20 := other.Values[i] + if _tgt != _src20 { + return false + } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { + return false + } + return true } func (p *TI16Column) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TI16Column(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI16Column(%+v)", *p) } func (p *TI16Column) Validate() error { - return nil + return nil } + // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TI32Column struct { - Values []int32 `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []int32 `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTI32Column() *TI32Column { - return &TI32Column{} + return &TI32Column{} } - func (p *TI32Column) GetValues() []int32 { - return p.Values + return p.Values } func (p *TI32Column) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TI32Column) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false; - var issetNulls bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); - } - if !issetNulls{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); - } - return nil -} - -func (p *TI32Column) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]int32, 0, size) - p.Values = tSlice - for i := 0; i < size; i ++ { -var _elem21 int32 - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem21 = v -} - p.Values = append(p.Values, _elem21) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TI32Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false + var issetNulls bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) + } + if !issetNulls { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) + } + return nil +} + +func (p *TI32Column) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int32, 0, size) + p.Values = tSlice + for i := 0; i < size; i++ { + var _elem21 int32 + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem21 = v + } + p.Values = append(p.Values, _elem21) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TI32Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Nulls = v + } + return nil } func (p *TI32Column) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI32Column"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TI32Column"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TI32Column) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteI32(ctx, int32(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) + } + return err } func (p *TI32Column) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) + } + return err } func (p *TI32Column) Equals(other *TI32Column) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src22 := other.Values[i] - if _tgt != _src22 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { + return false + } + for i, _tgt := range p.Values { + _src22 := other.Values[i] + if _tgt != _src22 { + return false + } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { + return false + } + return true } func (p *TI32Column) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TI32Column(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI32Column(%+v)", *p) } func (p *TI32Column) Validate() error { - return nil + return nil } + // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TI64Column struct { - Values []int64 `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []int64 `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTI64Column() *TI64Column { - return &TI64Column{} + return &TI64Column{} } - func (p *TI64Column) GetValues() []int64 { - return p.Values + return p.Values } func (p *TI64Column) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TI64Column) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false; - var issetNulls bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); - } - if !issetNulls{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); - } - return nil -} - -func (p *TI64Column) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]int64, 0, size) - p.Values = tSlice - for i := 0; i < size; i ++ { -var _elem23 int64 - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem23 = v -} - p.Values = append(p.Values, _elem23) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TI64Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false + var issetNulls bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) + } + if !issetNulls { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) + } + return nil +} + +func (p *TI64Column) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int64, 0, size) + p.Values = tSlice + for i := 0; i < size; i++ { + var _elem23 int64 + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem23 = v + } + p.Values = append(p.Values, _elem23) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TI64Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Nulls = v + } + return nil } func (p *TI64Column) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI64Column"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TI64Column"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TI64Column) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.I64, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteI64(ctx, int64(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.I64, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteI64(ctx, int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) + } + return err } func (p *TI64Column) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) + } + return err } func (p *TI64Column) Equals(other *TI64Column) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src24 := other.Values[i] - if _tgt != _src24 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { + return false + } + for i, _tgt := range p.Values { + _src24 := other.Values[i] + if _tgt != _src24 { + return false + } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { + return false + } + return true } func (p *TI64Column) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TI64Column(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI64Column(%+v)", *p) } func (p *TI64Column) Validate() error { - return nil + return nil } + // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TDoubleColumn struct { - Values []float64 `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []float64 `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTDoubleColumn() *TDoubleColumn { - return &TDoubleColumn{} + return &TDoubleColumn{} } - func (p *TDoubleColumn) GetValues() []float64 { - return p.Values + return p.Values } func (p *TDoubleColumn) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TDoubleColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false; - var issetNulls bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); - } - if !issetNulls{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); - } - return nil -} - -func (p *TDoubleColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]float64, 0, size) - p.Values = tSlice - for i := 0; i < size; i ++ { -var _elem25 float64 - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem25 = v -} - p.Values = append(p.Values, _elem25) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TDoubleColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false + var issetNulls bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) + } + if !issetNulls { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) + } + return nil +} + +func (p *TDoubleColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]float64, 0, size) + p.Values = tSlice + for i := 0; i < size; i++ { + var _elem25 float64 + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem25 = v + } + p.Values = append(p.Values, _elem25) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TDoubleColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Nulls = v + } + return nil } func (p *TDoubleColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TDoubleColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TDoubleColumn"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TDoubleColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.DOUBLE, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteDouble(ctx, float64(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.DOUBLE, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteDouble(ctx, float64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) + } + return err } func (p *TDoubleColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) + } + return err } func (p *TDoubleColumn) Equals(other *TDoubleColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src26 := other.Values[i] - if _tgt != _src26 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { + return false + } + for i, _tgt := range p.Values { + _src26 := other.Values[i] + if _tgt != _src26 { + return false + } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { + return false + } + return true } func (p *TDoubleColumn) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDoubleColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TDoubleColumn(%+v)", *p) } func (p *TDoubleColumn) Validate() error { - return nil + return nil } + // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TStringColumn struct { - Values []string `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []string `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTStringColumn() *TStringColumn { - return &TStringColumn{} + return &TStringColumn{} } - func (p *TStringColumn) GetValues() []string { - return p.Values + return p.Values } func (p *TStringColumn) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TStringColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false; - var issetNulls bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); - } - if !issetNulls{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); - } - return nil -} - -func (p *TStringColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]string, 0, size) - p.Values = tSlice - for i := 0; i < size; i ++ { -var _elem27 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem27 = v -} - p.Values = append(p.Values, _elem27) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TStringColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false + var issetNulls bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) + } + if !issetNulls { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) + } + return nil +} + +func (p *TStringColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.Values = tSlice + for i := 0; i < size; i++ { + var _elem27 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem27 = v + } + p.Values = append(p.Values, _elem27) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TStringColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Nulls = v + } + return nil } func (p *TStringColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStringColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TStringColumn"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TStringColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) + } + return err } func (p *TStringColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) + } + return err } func (p *TStringColumn) Equals(other *TStringColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src28 := other.Values[i] - if _tgt != _src28 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { + return false + } + for i, _tgt := range p.Values { + _src28 := other.Values[i] + if _tgt != _src28 { + return false + } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { + return false + } + return true } func (p *TStringColumn) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TStringColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TStringColumn(%+v)", *p) } func (p *TStringColumn) Validate() error { - return nil + return nil } + // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TBinaryColumn struct { - Values [][]byte `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values [][]byte `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTBinaryColumn() *TBinaryColumn { - return &TBinaryColumn{} + return &TBinaryColumn{} } - func (p *TBinaryColumn) GetValues() [][]byte { - return p.Values + return p.Values } func (p *TBinaryColumn) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TBinaryColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false; - var issetNulls bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); - } - if !issetNulls{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); - } - return nil -} - -func (p *TBinaryColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([][]byte, 0, size) - p.Values = tSlice - for i := 0; i < size; i ++ { -var _elem29 []byte - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem29 = v -} - p.Values = append(p.Values, _elem29) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TBinaryColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Nulls = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false + var issetNulls bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) + } + if !issetNulls { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) + } + return nil +} + +func (p *TBinaryColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Values = tSlice + for i := 0; i < size; i++ { + var _elem29 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem29 = v + } + p.Values = append(p.Values, _elem29) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TBinaryColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Nulls = v + } + return nil } func (p *TBinaryColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TBinaryColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TBinaryColumn"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TBinaryColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteBinary(ctx, v); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) + } + return err } func (p *TBinaryColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) + } + return err } func (p *TBinaryColumn) Equals(other *TBinaryColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { return false } - for i, _tgt := range p.Values { - _src30 := other.Values[i] - if bytes.Compare(_tgt, _src30) != 0 { return false } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { + return false + } + for i, _tgt := range p.Values { + _src30 := other.Values[i] + if bytes.Compare(_tgt, _src30) != 0 { + return false + } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { + return false + } + return true } func (p *TBinaryColumn) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TBinaryColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TBinaryColumn(%+v)", *p) } func (p *TBinaryColumn) Validate() error { - return nil + return nil } + // Attributes: -// - BoolVal -// - ByteVal -// - I16Val -// - I32Val -// - I64Val -// - DoubleVal -// - StringVal -// - BinaryVal +// - BoolVal +// - ByteVal +// - I16Val +// - I32Val +// - I64Val +// - DoubleVal +// - StringVal +// - BinaryVal type TColumn struct { - BoolVal *TBoolColumn `thrift:"boolVal,1" db:"boolVal" json:"boolVal,omitempty"` - ByteVal *TByteColumn `thrift:"byteVal,2" db:"byteVal" json:"byteVal,omitempty"` - I16Val *TI16Column `thrift:"i16Val,3" db:"i16Val" json:"i16Val,omitempty"` - I32Val *TI32Column `thrift:"i32Val,4" db:"i32Val" json:"i32Val,omitempty"` - I64Val *TI64Column `thrift:"i64Val,5" db:"i64Val" json:"i64Val,omitempty"` - DoubleVal *TDoubleColumn `thrift:"doubleVal,6" db:"doubleVal" json:"doubleVal,omitempty"` - StringVal *TStringColumn `thrift:"stringVal,7" db:"stringVal" json:"stringVal,omitempty"` - BinaryVal *TBinaryColumn `thrift:"binaryVal,8" db:"binaryVal" json:"binaryVal,omitempty"` + BoolVal *TBoolColumn `thrift:"boolVal,1" db:"boolVal" json:"boolVal,omitempty"` + ByteVal *TByteColumn `thrift:"byteVal,2" db:"byteVal" json:"byteVal,omitempty"` + I16Val *TI16Column `thrift:"i16Val,3" db:"i16Val" json:"i16Val,omitempty"` + I32Val *TI32Column `thrift:"i32Val,4" db:"i32Val" json:"i32Val,omitempty"` + I64Val *TI64Column `thrift:"i64Val,5" db:"i64Val" json:"i64Val,omitempty"` + DoubleVal *TDoubleColumn `thrift:"doubleVal,6" db:"doubleVal" json:"doubleVal,omitempty"` + StringVal *TStringColumn `thrift:"stringVal,7" db:"stringVal" json:"stringVal,omitempty"` + BinaryVal *TBinaryColumn `thrift:"binaryVal,8" db:"binaryVal" json:"binaryVal,omitempty"` } func NewTColumn() *TColumn { - return &TColumn{} + return &TColumn{} } var TColumn_BoolVal_DEFAULT *TBoolColumn + func (p *TColumn) GetBoolVal() *TBoolColumn { - if !p.IsSetBoolVal() { - return TColumn_BoolVal_DEFAULT - } -return p.BoolVal + if !p.IsSetBoolVal() { + return TColumn_BoolVal_DEFAULT + } + return p.BoolVal } + var TColumn_ByteVal_DEFAULT *TByteColumn + func (p *TColumn) GetByteVal() *TByteColumn { - if !p.IsSetByteVal() { - return TColumn_ByteVal_DEFAULT - } -return p.ByteVal + if !p.IsSetByteVal() { + return TColumn_ByteVal_DEFAULT + } + return p.ByteVal } + var TColumn_I16Val_DEFAULT *TI16Column + func (p *TColumn) GetI16Val() *TI16Column { - if !p.IsSetI16Val() { - return TColumn_I16Val_DEFAULT - } -return p.I16Val + if !p.IsSetI16Val() { + return TColumn_I16Val_DEFAULT + } + return p.I16Val } + var TColumn_I32Val_DEFAULT *TI32Column + func (p *TColumn) GetI32Val() *TI32Column { - if !p.IsSetI32Val() { - return TColumn_I32Val_DEFAULT - } -return p.I32Val + if !p.IsSetI32Val() { + return TColumn_I32Val_DEFAULT + } + return p.I32Val } + var TColumn_I64Val_DEFAULT *TI64Column + func (p *TColumn) GetI64Val() *TI64Column { - if !p.IsSetI64Val() { - return TColumn_I64Val_DEFAULT - } -return p.I64Val + if !p.IsSetI64Val() { + return TColumn_I64Val_DEFAULT + } + return p.I64Val } + var TColumn_DoubleVal_DEFAULT *TDoubleColumn + func (p *TColumn) GetDoubleVal() *TDoubleColumn { - if !p.IsSetDoubleVal() { - return TColumn_DoubleVal_DEFAULT - } -return p.DoubleVal + if !p.IsSetDoubleVal() { + return TColumn_DoubleVal_DEFAULT + } + return p.DoubleVal } + var TColumn_StringVal_DEFAULT *TStringColumn + func (p *TColumn) GetStringVal() *TStringColumn { - if !p.IsSetStringVal() { - return TColumn_StringVal_DEFAULT - } -return p.StringVal + if !p.IsSetStringVal() { + return TColumn_StringVal_DEFAULT + } + return p.StringVal } + var TColumn_BinaryVal_DEFAULT *TBinaryColumn + func (p *TColumn) GetBinaryVal() *TBinaryColumn { - if !p.IsSetBinaryVal() { - return TColumn_BinaryVal_DEFAULT - } -return p.BinaryVal + if !p.IsSetBinaryVal() { + return TColumn_BinaryVal_DEFAULT + } + return p.BinaryVal } func (p *TColumn) CountSetFieldsTColumn() int { - count := 0 - if (p.IsSetBoolVal()) { - count++ - } - if (p.IsSetByteVal()) { - count++ - } - if (p.IsSetI16Val()) { - count++ - } - if (p.IsSetI32Val()) { - count++ - } - if (p.IsSetI64Val()) { - count++ - } - if (p.IsSetDoubleVal()) { - count++ - } - if (p.IsSetStringVal()) { - count++ - } - if (p.IsSetBinaryVal()) { - count++ - } - return count + count := 0 + if p.IsSetBoolVal() { + count++ + } + if p.IsSetByteVal() { + count++ + } + if p.IsSetI16Val() { + count++ + } + if p.IsSetI32Val() { + count++ + } + if p.IsSetI64Val() { + count++ + } + if p.IsSetDoubleVal() { + count++ + } + if p.IsSetStringVal() { + count++ + } + if p.IsSetBinaryVal() { + count++ + } + return count } func (p *TColumn) IsSetBoolVal() bool { - return p.BoolVal != nil + return p.BoolVal != nil } func (p *TColumn) IsSetByteVal() bool { - return p.ByteVal != nil + return p.ByteVal != nil } func (p *TColumn) IsSetI16Val() bool { - return p.I16Val != nil + return p.I16Val != nil } func (p *TColumn) IsSetI32Val() bool { - return p.I32Val != nil + return p.I32Val != nil } func (p *TColumn) IsSetI64Val() bool { - return p.I64Val != nil + return p.I64Val != nil } func (p *TColumn) IsSetDoubleVal() bool { - return p.DoubleVal != nil + return p.DoubleVal != nil } func (p *TColumn) IsSetStringVal() bool { - return p.StringVal != nil + return p.StringVal != nil } func (p *TColumn) IsSetBinaryVal() bool { - return p.BinaryVal != nil + return p.BinaryVal != nil } func (p *TColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 8: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField8(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.BoolVal = &TBoolColumn{} - if err := p.BoolVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err) - } - return nil -} - -func (p *TColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ByteVal = &TByteColumn{} - if err := p.ByteVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err) - } - return nil -} - -func (p *TColumn) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.I16Val = &TI16Column{} - if err := p.I16Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err) - } - return nil -} - -func (p *TColumn) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.I32Val = &TI32Column{} - if err := p.I32Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err) - } - return nil -} - -func (p *TColumn) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - p.I64Val = &TI64Column{} - if err := p.I64Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err) - } - return nil -} - -func (p *TColumn) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - p.DoubleVal = &TDoubleColumn{} - if err := p.DoubleVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err) - } - return nil -} - -func (p *TColumn) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - p.StringVal = &TStringColumn{} - if err := p.StringVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err) - } - return nil -} - -func (p *TColumn) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { - p.BinaryVal = &TBinaryColumn{} - if err := p.BinaryVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BinaryVal), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.BoolVal = &TBoolColumn{} + if err := p.BoolVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err) + } + return nil +} + +func (p *TColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.ByteVal = &TByteColumn{} + if err := p.ByteVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err) + } + return nil +} + +func (p *TColumn) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.I16Val = &TI16Column{} + if err := p.I16Val.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err) + } + return nil +} + +func (p *TColumn) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.I32Val = &TI32Column{} + if err := p.I32Val.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err) + } + return nil +} + +func (p *TColumn) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + p.I64Val = &TI64Column{} + if err := p.I64Val.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err) + } + return nil +} + +func (p *TColumn) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + p.DoubleVal = &TDoubleColumn{} + if err := p.DoubleVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err) + } + return nil +} + +func (p *TColumn) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + p.StringVal = &TStringColumn{} + if err := p.StringVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err) + } + return nil +} + +func (p *TColumn) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + p.BinaryVal = &TBinaryColumn{} + if err := p.BinaryVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BinaryVal), err) + } + return nil } func (p *TColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTColumn(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - if err := p.writeField7(ctx, oprot); err != nil { return err } - if err := p.writeField8(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if c := p.CountSetFieldsTColumn(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TColumn"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField6(ctx, oprot); err != nil { + return err + } + if err := p.writeField7(ctx, oprot); err != nil { + return err + } + if err := p.writeField8(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBoolVal() { - if err := oprot.WriteFieldBegin(ctx, "boolVal", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:boolVal: ", p), err) } - if err := p.BoolVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) } - } - return err + if p.IsSetBoolVal() { + if err := oprot.WriteFieldBegin(ctx, "boolVal", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:boolVal: ", p), err) + } + if err := p.BoolVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) + } + } + return err } func (p *TColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetByteVal() { - if err := oprot.WriteFieldBegin(ctx, "byteVal", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:byteVal: ", p), err) } - if err := p.ByteVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) } - } - return err + if p.IsSetByteVal() { + if err := oprot.WriteFieldBegin(ctx, "byteVal", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:byteVal: ", p), err) + } + if err := p.ByteVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) + } + } + return err } func (p *TColumn) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI16Val() { - if err := oprot.WriteFieldBegin(ctx, "i16Val", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i16Val: ", p), err) } - if err := p.I16Val.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) } - } - return err + if p.IsSetI16Val() { + if err := oprot.WriteFieldBegin(ctx, "i16Val", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i16Val: ", p), err) + } + if err := p.I16Val.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) + } + } + return err } func (p *TColumn) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI32Val() { - if err := oprot.WriteFieldBegin(ctx, "i32Val", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:i32Val: ", p), err) } - if err := p.I32Val.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) } - } - return err + if p.IsSetI32Val() { + if err := oprot.WriteFieldBegin(ctx, "i32Val", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:i32Val: ", p), err) + } + if err := p.I32Val.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) + } + } + return err } func (p *TColumn) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI64Val() { - if err := oprot.WriteFieldBegin(ctx, "i64Val", thrift.STRUCT, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:i64Val: ", p), err) } - if err := p.I64Val.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) } - } - return err + if p.IsSetI64Val() { + if err := oprot.WriteFieldBegin(ctx, "i64Val", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:i64Val: ", p), err) + } + if err := p.I64Val.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) + } + } + return err } func (p *TColumn) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDoubleVal() { - if err := oprot.WriteFieldBegin(ctx, "doubleVal", thrift.STRUCT, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:doubleVal: ", p), err) } - if err := p.DoubleVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) } - } - return err + if p.IsSetDoubleVal() { + if err := oprot.WriteFieldBegin(ctx, "doubleVal", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:doubleVal: ", p), err) + } + if err := p.DoubleVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) + } + } + return err } func (p *TColumn) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringVal() { - if err := oprot.WriteFieldBegin(ctx, "stringVal", thrift.STRUCT, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stringVal: ", p), err) } - if err := p.StringVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) } - } - return err + if p.IsSetStringVal() { + if err := oprot.WriteFieldBegin(ctx, "stringVal", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stringVal: ", p), err) + } + if err := p.StringVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) + } + } + return err } func (p *TColumn) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBinaryVal() { - if err := oprot.WriteFieldBegin(ctx, "binaryVal", thrift.STRUCT, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:binaryVal: ", p), err) } - if err := p.BinaryVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BinaryVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:binaryVal: ", p), err) } - } - return err + if p.IsSetBinaryVal() { + if err := oprot.WriteFieldBegin(ctx, "binaryVal", thrift.STRUCT, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:binaryVal: ", p), err) + } + if err := p.BinaryVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BinaryVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:binaryVal: ", p), err) + } + } + return err } func (p *TColumn) Equals(other *TColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.BoolVal.Equals(other.BoolVal) { return false } - if !p.ByteVal.Equals(other.ByteVal) { return false } - if !p.I16Val.Equals(other.I16Val) { return false } - if !p.I32Val.Equals(other.I32Val) { return false } - if !p.I64Val.Equals(other.I64Val) { return false } - if !p.DoubleVal.Equals(other.DoubleVal) { return false } - if !p.StringVal.Equals(other.StringVal) { return false } - if !p.BinaryVal.Equals(other.BinaryVal) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.BoolVal.Equals(other.BoolVal) { + return false + } + if !p.ByteVal.Equals(other.ByteVal) { + return false + } + if !p.I16Val.Equals(other.I16Val) { + return false + } + if !p.I32Val.Equals(other.I32Val) { + return false + } + if !p.I64Val.Equals(other.I64Val) { + return false + } + if !p.DoubleVal.Equals(other.DoubleVal) { + return false + } + if !p.StringVal.Equals(other.StringVal) { + return false + } + if !p.BinaryVal.Equals(other.BinaryVal) { + return false + } + return true } func (p *TColumn) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TColumn(%+v)", *p) } func (p *TColumn) Validate() error { - return nil + return nil } + // Attributes: -// - CompressionCodec +// - CompressionCodec type TDBSqlJsonArrayFormat struct { - CompressionCodec *TDBSqlCompressionCodec `thrift:"compressionCodec,1" db:"compressionCodec" json:"compressionCodec,omitempty"` + CompressionCodec *TDBSqlCompressionCodec `thrift:"compressionCodec,1" db:"compressionCodec" json:"compressionCodec,omitempty"` } func NewTDBSqlJsonArrayFormat() *TDBSqlJsonArrayFormat { - return &TDBSqlJsonArrayFormat{} + return &TDBSqlJsonArrayFormat{} } var TDBSqlJsonArrayFormat_CompressionCodec_DEFAULT TDBSqlCompressionCodec + func (p *TDBSqlJsonArrayFormat) GetCompressionCodec() TDBSqlCompressionCodec { - if !p.IsSetCompressionCodec() { - return TDBSqlJsonArrayFormat_CompressionCodec_DEFAULT - } -return *p.CompressionCodec + if !p.IsSetCompressionCodec() { + return TDBSqlJsonArrayFormat_CompressionCodec_DEFAULT + } + return *p.CompressionCodec } func (p *TDBSqlJsonArrayFormat) IsSetCompressionCodec() bool { - return p.CompressionCodec != nil + return p.CompressionCodec != nil } func (p *TDBSqlJsonArrayFormat) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TDBSqlJsonArrayFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TDBSqlCompressionCodec(v) - p.CompressionCodec = &temp -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TDBSqlJsonArrayFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := TDBSqlCompressionCodec(v) + p.CompressionCodec = &temp + } + return nil } func (p *TDBSqlJsonArrayFormat) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TDBSqlJsonArrayFormat"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TDBSqlJsonArrayFormat"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TDBSqlJsonArrayFormat) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCompressionCodec() { - if err := oprot.WriteFieldBegin(ctx, "compressionCodec", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:compressionCodec: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.CompressionCodec)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.compressionCodec (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:compressionCodec: ", p), err) } - } - return err + if p.IsSetCompressionCodec() { + if err := oprot.WriteFieldBegin(ctx, "compressionCodec", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:compressionCodec: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.CompressionCodec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.compressionCodec (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:compressionCodec: ", p), err) + } + } + return err } func (p *TDBSqlJsonArrayFormat) Equals(other *TDBSqlJsonArrayFormat) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.CompressionCodec != other.CompressionCodec { - if p.CompressionCodec == nil || other.CompressionCodec == nil { - return false - } - if (*p.CompressionCodec) != (*other.CompressionCodec) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.CompressionCodec != other.CompressionCodec { + if p.CompressionCodec == nil || other.CompressionCodec == nil { + return false + } + if (*p.CompressionCodec) != (*other.CompressionCodec) { + return false + } + } + return true } func (p *TDBSqlJsonArrayFormat) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDBSqlJsonArrayFormat(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TDBSqlJsonArrayFormat(%+v)", *p) } func (p *TDBSqlJsonArrayFormat) Validate() error { - return nil + return nil } + // Attributes: -// - CompressionCodec +// - CompressionCodec type TDBSqlCsvFormat struct { - CompressionCodec *TDBSqlCompressionCodec `thrift:"compressionCodec,1" db:"compressionCodec" json:"compressionCodec,omitempty"` + CompressionCodec *TDBSqlCompressionCodec `thrift:"compressionCodec,1" db:"compressionCodec" json:"compressionCodec,omitempty"` } func NewTDBSqlCsvFormat() *TDBSqlCsvFormat { - return &TDBSqlCsvFormat{} + return &TDBSqlCsvFormat{} } var TDBSqlCsvFormat_CompressionCodec_DEFAULT TDBSqlCompressionCodec + func (p *TDBSqlCsvFormat) GetCompressionCodec() TDBSqlCompressionCodec { - if !p.IsSetCompressionCodec() { - return TDBSqlCsvFormat_CompressionCodec_DEFAULT - } -return *p.CompressionCodec + if !p.IsSetCompressionCodec() { + return TDBSqlCsvFormat_CompressionCodec_DEFAULT + } + return *p.CompressionCodec } func (p *TDBSqlCsvFormat) IsSetCompressionCodec() bool { - return p.CompressionCodec != nil + return p.CompressionCodec != nil } func (p *TDBSqlCsvFormat) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TDBSqlCsvFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TDBSqlCompressionCodec(v) - p.CompressionCodec = &temp -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TDBSqlCsvFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := TDBSqlCompressionCodec(v) + p.CompressionCodec = &temp + } + return nil } func (p *TDBSqlCsvFormat) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TDBSqlCsvFormat"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TDBSqlCsvFormat"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TDBSqlCsvFormat) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCompressionCodec() { - if err := oprot.WriteFieldBegin(ctx, "compressionCodec", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:compressionCodec: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.CompressionCodec)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.compressionCodec (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:compressionCodec: ", p), err) } - } - return err + if p.IsSetCompressionCodec() { + if err := oprot.WriteFieldBegin(ctx, "compressionCodec", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:compressionCodec: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.CompressionCodec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.compressionCodec (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:compressionCodec: ", p), err) + } + } + return err } func (p *TDBSqlCsvFormat) Equals(other *TDBSqlCsvFormat) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.CompressionCodec != other.CompressionCodec { - if p.CompressionCodec == nil || other.CompressionCodec == nil { - return false - } - if (*p.CompressionCodec) != (*other.CompressionCodec) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.CompressionCodec != other.CompressionCodec { + if p.CompressionCodec == nil || other.CompressionCodec == nil { + return false + } + if (*p.CompressionCodec) != (*other.CompressionCodec) { + return false + } + } + return true } func (p *TDBSqlCsvFormat) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDBSqlCsvFormat(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TDBSqlCsvFormat(%+v)", *p) } func (p *TDBSqlCsvFormat) Validate() error { - return nil + return nil } + // Attributes: -// - ArrowLayout -// - CompressionCodec +// - ArrowLayout +// - CompressionCodec type TDBSqlArrowFormat struct { - ArrowLayout *TDBSqlArrowLayout `thrift:"arrowLayout,1" db:"arrowLayout" json:"arrowLayout,omitempty"` - CompressionCodec *TDBSqlCompressionCodec `thrift:"compressionCodec,2" db:"compressionCodec" json:"compressionCodec,omitempty"` + ArrowLayout *TDBSqlArrowLayout `thrift:"arrowLayout,1" db:"arrowLayout" json:"arrowLayout,omitempty"` + CompressionCodec *TDBSqlCompressionCodec `thrift:"compressionCodec,2" db:"compressionCodec" json:"compressionCodec,omitempty"` } func NewTDBSqlArrowFormat() *TDBSqlArrowFormat { - return &TDBSqlArrowFormat{} + return &TDBSqlArrowFormat{} } var TDBSqlArrowFormat_ArrowLayout_DEFAULT TDBSqlArrowLayout + func (p *TDBSqlArrowFormat) GetArrowLayout() TDBSqlArrowLayout { - if !p.IsSetArrowLayout() { - return TDBSqlArrowFormat_ArrowLayout_DEFAULT - } -return *p.ArrowLayout + if !p.IsSetArrowLayout() { + return TDBSqlArrowFormat_ArrowLayout_DEFAULT + } + return *p.ArrowLayout } + var TDBSqlArrowFormat_CompressionCodec_DEFAULT TDBSqlCompressionCodec + func (p *TDBSqlArrowFormat) GetCompressionCodec() TDBSqlCompressionCodec { - if !p.IsSetCompressionCodec() { - return TDBSqlArrowFormat_CompressionCodec_DEFAULT - } -return *p.CompressionCodec + if !p.IsSetCompressionCodec() { + return TDBSqlArrowFormat_CompressionCodec_DEFAULT + } + return *p.CompressionCodec } func (p *TDBSqlArrowFormat) IsSetArrowLayout() bool { - return p.ArrowLayout != nil + return p.ArrowLayout != nil } func (p *TDBSqlArrowFormat) IsSetCompressionCodec() bool { - return p.CompressionCodec != nil + return p.CompressionCodec != nil } func (p *TDBSqlArrowFormat) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TDBSqlArrowFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TDBSqlArrowLayout(v) - p.ArrowLayout = &temp -} - return nil -} - -func (p *TDBSqlArrowFormat) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TDBSqlCompressionCodec(v) - p.CompressionCodec = &temp -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TDBSqlArrowFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := TDBSqlArrowLayout(v) + p.ArrowLayout = &temp + } + return nil +} + +func (p *TDBSqlArrowFormat) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TDBSqlCompressionCodec(v) + p.CompressionCodec = &temp + } + return nil } func (p *TDBSqlArrowFormat) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TDBSqlArrowFormat"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TDBSqlArrowFormat"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TDBSqlArrowFormat) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArrowLayout() { - if err := oprot.WriteFieldBegin(ctx, "arrowLayout", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:arrowLayout: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.ArrowLayout)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.arrowLayout (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:arrowLayout: ", p), err) } - } - return err + if p.IsSetArrowLayout() { + if err := oprot.WriteFieldBegin(ctx, "arrowLayout", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:arrowLayout: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.ArrowLayout)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.arrowLayout (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:arrowLayout: ", p), err) + } + } + return err } func (p *TDBSqlArrowFormat) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCompressionCodec() { - if err := oprot.WriteFieldBegin(ctx, "compressionCodec", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:compressionCodec: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.CompressionCodec)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.compressionCodec (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:compressionCodec: ", p), err) } - } - return err + if p.IsSetCompressionCodec() { + if err := oprot.WriteFieldBegin(ctx, "compressionCodec", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:compressionCodec: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.CompressionCodec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.compressionCodec (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:compressionCodec: ", p), err) + } + } + return err } func (p *TDBSqlArrowFormat) Equals(other *TDBSqlArrowFormat) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.ArrowLayout != other.ArrowLayout { - if p.ArrowLayout == nil || other.ArrowLayout == nil { - return false - } - if (*p.ArrowLayout) != (*other.ArrowLayout) { return false } - } - if p.CompressionCodec != other.CompressionCodec { - if p.CompressionCodec == nil || other.CompressionCodec == nil { - return false - } - if (*p.CompressionCodec) != (*other.CompressionCodec) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ArrowLayout != other.ArrowLayout { + if p.ArrowLayout == nil || other.ArrowLayout == nil { + return false + } + if (*p.ArrowLayout) != (*other.ArrowLayout) { + return false + } + } + if p.CompressionCodec != other.CompressionCodec { + if p.CompressionCodec == nil || other.CompressionCodec == nil { + return false + } + if (*p.CompressionCodec) != (*other.CompressionCodec) { + return false + } + } + return true } func (p *TDBSqlArrowFormat) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDBSqlArrowFormat(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TDBSqlArrowFormat(%+v)", *p) } func (p *TDBSqlArrowFormat) Validate() error { - return nil + return nil } + // Attributes: -// - ArrowFormat -// - CsvFormat -// - JsonArrayFormat +// - ArrowFormat +// - CsvFormat +// - JsonArrayFormat type TDBSqlResultFormat struct { - ArrowFormat *TDBSqlArrowFormat `thrift:"arrowFormat,1" db:"arrowFormat" json:"arrowFormat,omitempty"` - CsvFormat *TDBSqlCsvFormat `thrift:"csvFormat,2" db:"csvFormat" json:"csvFormat,omitempty"` - JsonArrayFormat *TDBSqlJsonArrayFormat `thrift:"jsonArrayFormat,3" db:"jsonArrayFormat" json:"jsonArrayFormat,omitempty"` + ArrowFormat *TDBSqlArrowFormat `thrift:"arrowFormat,1" db:"arrowFormat" json:"arrowFormat,omitempty"` + CsvFormat *TDBSqlCsvFormat `thrift:"csvFormat,2" db:"csvFormat" json:"csvFormat,omitempty"` + JsonArrayFormat *TDBSqlJsonArrayFormat `thrift:"jsonArrayFormat,3" db:"jsonArrayFormat" json:"jsonArrayFormat,omitempty"` } func NewTDBSqlResultFormat() *TDBSqlResultFormat { - return &TDBSqlResultFormat{} + return &TDBSqlResultFormat{} } var TDBSqlResultFormat_ArrowFormat_DEFAULT *TDBSqlArrowFormat + func (p *TDBSqlResultFormat) GetArrowFormat() *TDBSqlArrowFormat { - if !p.IsSetArrowFormat() { - return TDBSqlResultFormat_ArrowFormat_DEFAULT - } -return p.ArrowFormat + if !p.IsSetArrowFormat() { + return TDBSqlResultFormat_ArrowFormat_DEFAULT + } + return p.ArrowFormat } + var TDBSqlResultFormat_CsvFormat_DEFAULT *TDBSqlCsvFormat + func (p *TDBSqlResultFormat) GetCsvFormat() *TDBSqlCsvFormat { - if !p.IsSetCsvFormat() { - return TDBSqlResultFormat_CsvFormat_DEFAULT - } -return p.CsvFormat + if !p.IsSetCsvFormat() { + return TDBSqlResultFormat_CsvFormat_DEFAULT + } + return p.CsvFormat } + var TDBSqlResultFormat_JsonArrayFormat_DEFAULT *TDBSqlJsonArrayFormat + func (p *TDBSqlResultFormat) GetJsonArrayFormat() *TDBSqlJsonArrayFormat { - if !p.IsSetJsonArrayFormat() { - return TDBSqlResultFormat_JsonArrayFormat_DEFAULT - } -return p.JsonArrayFormat + if !p.IsSetJsonArrayFormat() { + return TDBSqlResultFormat_JsonArrayFormat_DEFAULT + } + return p.JsonArrayFormat } func (p *TDBSqlResultFormat) CountSetFieldsTDBSqlResultFormat() int { - count := 0 - if (p.IsSetArrowFormat()) { - count++ - } - if (p.IsSetCsvFormat()) { - count++ - } - if (p.IsSetJsonArrayFormat()) { - count++ - } - return count + count := 0 + if p.IsSetArrowFormat() { + count++ + } + if p.IsSetCsvFormat() { + count++ + } + if p.IsSetJsonArrayFormat() { + count++ + } + return count } func (p *TDBSqlResultFormat) IsSetArrowFormat() bool { - return p.ArrowFormat != nil + return p.ArrowFormat != nil } func (p *TDBSqlResultFormat) IsSetCsvFormat() bool { - return p.CsvFormat != nil + return p.CsvFormat != nil } func (p *TDBSqlResultFormat) IsSetJsonArrayFormat() bool { - return p.JsonArrayFormat != nil + return p.JsonArrayFormat != nil } func (p *TDBSqlResultFormat) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TDBSqlResultFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.ArrowFormat = &TDBSqlArrowFormat{} - if err := p.ArrowFormat.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ArrowFormat), err) - } - return nil -} - -func (p *TDBSqlResultFormat) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.CsvFormat = &TDBSqlCsvFormat{} - if err := p.CsvFormat.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CsvFormat), err) - } - return nil -} - -func (p *TDBSqlResultFormat) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.JsonArrayFormat = &TDBSqlJsonArrayFormat{} - if err := p.JsonArrayFormat.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JsonArrayFormat), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TDBSqlResultFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.ArrowFormat = &TDBSqlArrowFormat{} + if err := p.ArrowFormat.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ArrowFormat), err) + } + return nil +} + +func (p *TDBSqlResultFormat) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.CsvFormat = &TDBSqlCsvFormat{} + if err := p.CsvFormat.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CsvFormat), err) + } + return nil +} + +func (p *TDBSqlResultFormat) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.JsonArrayFormat = &TDBSqlJsonArrayFormat{} + if err := p.JsonArrayFormat.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JsonArrayFormat), err) + } + return nil } func (p *TDBSqlResultFormat) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTDBSqlResultFormat(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TDBSqlResultFormat"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if c := p.CountSetFieldsTDBSqlResultFormat(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TDBSqlResultFormat"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TDBSqlResultFormat) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArrowFormat() { - if err := oprot.WriteFieldBegin(ctx, "arrowFormat", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:arrowFormat: ", p), err) } - if err := p.ArrowFormat.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ArrowFormat), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:arrowFormat: ", p), err) } - } - return err + if p.IsSetArrowFormat() { + if err := oprot.WriteFieldBegin(ctx, "arrowFormat", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:arrowFormat: ", p), err) + } + if err := p.ArrowFormat.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ArrowFormat), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:arrowFormat: ", p), err) + } + } + return err } func (p *TDBSqlResultFormat) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCsvFormat() { - if err := oprot.WriteFieldBegin(ctx, "csvFormat", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:csvFormat: ", p), err) } - if err := p.CsvFormat.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CsvFormat), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:csvFormat: ", p), err) } - } - return err + if p.IsSetCsvFormat() { + if err := oprot.WriteFieldBegin(ctx, "csvFormat", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:csvFormat: ", p), err) + } + if err := p.CsvFormat.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CsvFormat), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:csvFormat: ", p), err) + } + } + return err } func (p *TDBSqlResultFormat) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetJsonArrayFormat() { - if err := oprot.WriteFieldBegin(ctx, "jsonArrayFormat", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:jsonArrayFormat: ", p), err) } - if err := p.JsonArrayFormat.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JsonArrayFormat), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:jsonArrayFormat: ", p), err) } - } - return err + if p.IsSetJsonArrayFormat() { + if err := oprot.WriteFieldBegin(ctx, "jsonArrayFormat", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:jsonArrayFormat: ", p), err) + } + if err := p.JsonArrayFormat.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JsonArrayFormat), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:jsonArrayFormat: ", p), err) + } + } + return err } func (p *TDBSqlResultFormat) Equals(other *TDBSqlResultFormat) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.ArrowFormat.Equals(other.ArrowFormat) { return false } - if !p.CsvFormat.Equals(other.CsvFormat) { return false } - if !p.JsonArrayFormat.Equals(other.JsonArrayFormat) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.ArrowFormat.Equals(other.ArrowFormat) { + return false + } + if !p.CsvFormat.Equals(other.CsvFormat) { + return false + } + if !p.JsonArrayFormat.Equals(other.JsonArrayFormat) { + return false + } + return true } func (p *TDBSqlResultFormat) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDBSqlResultFormat(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TDBSqlResultFormat(%+v)", *p) } func (p *TDBSqlResultFormat) Validate() error { - return nil + return nil } + // Attributes: -// - Batch -// - RowCount +// - Batch +// - RowCount type TSparkArrowBatch struct { - Batch []byte `thrift:"batch,1,required" db:"batch" json:"batch"` - RowCount int64 `thrift:"rowCount,2,required" db:"rowCount" json:"rowCount"` + Batch []byte `thrift:"batch,1,required" db:"batch" json:"batch"` + RowCount int64 `thrift:"rowCount,2,required" db:"rowCount" json:"rowCount"` } func NewTSparkArrowBatch() *TSparkArrowBatch { - return &TSparkArrowBatch{} + return &TSparkArrowBatch{} } - func (p *TSparkArrowBatch) GetBatch() []byte { - return p.Batch + return p.Batch } func (p *TSparkArrowBatch) GetRowCount() int64 { - return p.RowCount + return p.RowCount } func (p *TSparkArrowBatch) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetBatch bool = false; - var issetRowCount bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetBatch = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I64 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetRowCount = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetBatch{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Batch is not set")); - } - if !issetRowCount{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field RowCount is not set")); - } - return nil -} - -func (p *TSparkArrowBatch) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Batch = v -} - return nil -} - -func (p *TSparkArrowBatch) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.RowCount = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetBatch bool = false + var issetRowCount bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetBatch = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetRowCount = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetBatch { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Batch is not set")) + } + if !issetRowCount { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field RowCount is not set")) + } + return nil +} + +func (p *TSparkArrowBatch) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Batch = v + } + return nil +} + +func (p *TSparkArrowBatch) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.RowCount = v + } + return nil } func (p *TSparkArrowBatch) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkArrowBatch"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkArrowBatch"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TSparkArrowBatch) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "batch", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:batch: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Batch); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.batch (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:batch: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "batch", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:batch: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.Batch); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.batch (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:batch: ", p), err) + } + return err } func (p *TSparkArrowBatch) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "rowCount", thrift.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rowCount: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.RowCount)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.rowCount (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rowCount: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "rowCount", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rowCount: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.RowCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.rowCount (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rowCount: ", p), err) + } + return err } func (p *TSparkArrowBatch) Equals(other *TSparkArrowBatch) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if bytes.Compare(p.Batch, other.Batch) != 0 { return false } - if p.RowCount != other.RowCount { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Batch, other.Batch) != 0 { + return false + } + if p.RowCount != other.RowCount { + return false + } + return true } func (p *TSparkArrowBatch) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkArrowBatch(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkArrowBatch(%+v)", *p) } func (p *TSparkArrowBatch) Validate() error { - return nil + return nil } + // Attributes: -// - FileLink -// - ExpiryTime -// - StartRowOffset -// - RowCount -// - BytesNum -// - HttpHeaders +// - FileLink +// - ExpiryTime +// - StartRowOffset +// - RowCount +// - BytesNum +// - HttpHeaders type TSparkArrowResultLink struct { - FileLink string `thrift:"fileLink,1,required" db:"fileLink" json:"fileLink"` - ExpiryTime int64 `thrift:"expiryTime,2,required" db:"expiryTime" json:"expiryTime"` - StartRowOffset int64 `thrift:"startRowOffset,3,required" db:"startRowOffset" json:"startRowOffset"` - RowCount int64 `thrift:"rowCount,4,required" db:"rowCount" json:"rowCount"` - BytesNum int64 `thrift:"bytesNum,5,required" db:"bytesNum" json:"bytesNum"` - HttpHeaders map[string]string `thrift:"httpHeaders,6" db:"httpHeaders" json:"httpHeaders,omitempty"` + FileLink string `thrift:"fileLink,1,required" db:"fileLink" json:"fileLink"` + ExpiryTime int64 `thrift:"expiryTime,2,required" db:"expiryTime" json:"expiryTime"` + StartRowOffset int64 `thrift:"startRowOffset,3,required" db:"startRowOffset" json:"startRowOffset"` + RowCount int64 `thrift:"rowCount,4,required" db:"rowCount" json:"rowCount"` + BytesNum int64 `thrift:"bytesNum,5,required" db:"bytesNum" json:"bytesNum"` + HttpHeaders map[string]string `thrift:"httpHeaders,6" db:"httpHeaders" json:"httpHeaders,omitempty"` } func NewTSparkArrowResultLink() *TSparkArrowResultLink { - return &TSparkArrowResultLink{} + return &TSparkArrowResultLink{} } - func (p *TSparkArrowResultLink) GetFileLink() string { - return p.FileLink + return p.FileLink } func (p *TSparkArrowResultLink) GetExpiryTime() int64 { - return p.ExpiryTime + return p.ExpiryTime } func (p *TSparkArrowResultLink) GetStartRowOffset() int64 { - return p.StartRowOffset + return p.StartRowOffset } func (p *TSparkArrowResultLink) GetRowCount() int64 { - return p.RowCount + return p.RowCount } func (p *TSparkArrowResultLink) GetBytesNum() int64 { - return p.BytesNum + return p.BytesNum } + var TSparkArrowResultLink_HttpHeaders_DEFAULT map[string]string func (p *TSparkArrowResultLink) GetHttpHeaders() map[string]string { - return p.HttpHeaders + return p.HttpHeaders } func (p *TSparkArrowResultLink) IsSetHttpHeaders() bool { - return p.HttpHeaders != nil + return p.HttpHeaders != nil } func (p *TSparkArrowResultLink) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetFileLink bool = false; - var issetExpiryTime bool = false; - var issetStartRowOffset bool = false; - var issetRowCount bool = false; - var issetBytesNum bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetFileLink = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I64 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetExpiryTime = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I64 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetStartRowOffset = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I64 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - issetRowCount = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.I64 { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - issetBytesNum = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.MAP { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetFileLink{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FileLink is not set")); - } - if !issetExpiryTime{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ExpiryTime is not set")); - } - if !issetStartRowOffset{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartRowOffset is not set")); - } - if !issetRowCount{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field RowCount is not set")); - } - if !issetBytesNum{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field BytesNum is not set")); - } - return nil -} - -func (p *TSparkArrowResultLink) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.FileLink = v -} - return nil -} - -func (p *TSparkArrowResultLink) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.ExpiryTime = v -} - return nil -} - -func (p *TSparkArrowResultLink) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.StartRowOffset = v -} - return nil -} - -func (p *TSparkArrowResultLink) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.RowCount = v -} - return nil -} - -func (p *TSparkArrowResultLink) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.BytesNum = v -} - return nil -} - -func (p *TSparkArrowResultLink) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]string, size) - p.HttpHeaders = tMap - for i := 0; i < size; i ++ { -var _key31 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key31 = v -} -var _val32 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _val32 = v -} - p.HttpHeaders[_key31] = _val32 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetFileLink bool = false + var issetExpiryTime bool = false + var issetStartRowOffset bool = false + var issetRowCount bool = false + var issetBytesNum bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetFileLink = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetExpiryTime = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetStartRowOffset = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + issetRowCount = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + issetBytesNum = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.MAP { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetFileLink { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FileLink is not set")) + } + if !issetExpiryTime { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ExpiryTime is not set")) + } + if !issetStartRowOffset { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartRowOffset is not set")) + } + if !issetRowCount { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field RowCount is not set")) + } + if !issetBytesNum { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field BytesNum is not set")) + } + return nil +} + +func (p *TSparkArrowResultLink) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.FileLink = v + } + return nil +} + +func (p *TSparkArrowResultLink) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.ExpiryTime = v + } + return nil +} + +func (p *TSparkArrowResultLink) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.StartRowOffset = v + } + return nil +} + +func (p *TSparkArrowResultLink) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.RowCount = v + } + return nil +} + +func (p *TSparkArrowResultLink) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.BytesNum = v + } + return nil +} + +func (p *TSparkArrowResultLink) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.HttpHeaders = tMap + for i := 0; i < size; i++ { + var _key31 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key31 = v + } + var _val32 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val32 = v + } + p.HttpHeaders[_key31] = _val32 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil } func (p *TSparkArrowResultLink) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkArrowResultLink"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkArrowResultLink"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField6(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TSparkArrowResultLink) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "fileLink", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:fileLink: ", p), err) } - if err := oprot.WriteString(ctx, string(p.FileLink)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.fileLink (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:fileLink: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "fileLink", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:fileLink: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.FileLink)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fileLink (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:fileLink: ", p), err) + } + return err } func (p *TSparkArrowResultLink) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "expiryTime", thrift.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:expiryTime: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.ExpiryTime)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.expiryTime (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:expiryTime: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "expiryTime", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:expiryTime: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.ExpiryTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.expiryTime (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:expiryTime: ", p), err) + } + return err } func (p *TSparkArrowResultLink) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:startRowOffset: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.StartRowOffset)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:startRowOffset: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:startRowOffset: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.StartRowOffset)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:startRowOffset: ", p), err) + } + return err } func (p *TSparkArrowResultLink) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "rowCount", thrift.I64, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:rowCount: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.RowCount)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.rowCount (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:rowCount: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "rowCount", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:rowCount: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.RowCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.rowCount (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:rowCount: ", p), err) + } + return err } func (p *TSparkArrowResultLink) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "bytesNum", thrift.I64, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:bytesNum: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.BytesNum)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.bytesNum (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:bytesNum: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "bytesNum", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:bytesNum: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.BytesNum)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.bytesNum (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:bytesNum: ", p), err) + } + return err } func (p *TSparkArrowResultLink) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetHttpHeaders() { - if err := oprot.WriteFieldBegin(ctx, "httpHeaders", thrift.MAP, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:httpHeaders: ", p), err) } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.HttpHeaders)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.HttpHeaders { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:httpHeaders: ", p), err) } - } - return err + if p.IsSetHttpHeaders() { + if err := oprot.WriteFieldBegin(ctx, "httpHeaders", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:httpHeaders: ", p), err) + } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.HttpHeaders)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.HttpHeaders { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:httpHeaders: ", p), err) + } + } + return err } func (p *TSparkArrowResultLink) Equals(other *TSparkArrowResultLink) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.FileLink != other.FileLink { return false } - if p.ExpiryTime != other.ExpiryTime { return false } - if p.StartRowOffset != other.StartRowOffset { return false } - if p.RowCount != other.RowCount { return false } - if p.BytesNum != other.BytesNum { return false } - if len(p.HttpHeaders) != len(other.HttpHeaders) { return false } - for k, _tgt := range p.HttpHeaders { - _src33 := other.HttpHeaders[k] - if _tgt != _src33 { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.FileLink != other.FileLink { + return false + } + if p.ExpiryTime != other.ExpiryTime { + return false + } + if p.StartRowOffset != other.StartRowOffset { + return false + } + if p.RowCount != other.RowCount { + return false + } + if p.BytesNum != other.BytesNum { + return false + } + if len(p.HttpHeaders) != len(other.HttpHeaders) { + return false + } + for k, _tgt := range p.HttpHeaders { + _src33 := other.HttpHeaders[k] + if _tgt != _src33 { + return false + } + } + return true } func (p *TSparkArrowResultLink) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkArrowResultLink(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkArrowResultLink(%+v)", *p) } func (p *TSparkArrowResultLink) Validate() error { - return nil + return nil } + // Attributes: -// - StartRowOffset -// - Rows -// - Columns -// - BinaryColumns -// - ColumnCount -// - ArrowBatches -// - ResultLinks +// - StartRowOffset +// - Rows +// - Columns +// - BinaryColumns +// - ColumnCount +// - ArrowBatches +// - ResultLinks type TRowSet struct { - StartRowOffset int64 `thrift:"startRowOffset,1,required" db:"startRowOffset" json:"startRowOffset"` - Rows []*TRow `thrift:"rows,2,required" db:"rows" json:"rows"` - Columns []*TColumn `thrift:"columns,3" db:"columns" json:"columns,omitempty"` - BinaryColumns []byte `thrift:"binaryColumns,4" db:"binaryColumns" json:"binaryColumns,omitempty"` - ColumnCount *int32 `thrift:"columnCount,5" db:"columnCount" json:"columnCount,omitempty"` - // unused fields # 6 to 1280 - ArrowBatches []*TSparkArrowBatch `thrift:"arrowBatches,1281" db:"arrowBatches" json:"arrowBatches,omitempty"` - ResultLinks []*TSparkArrowResultLink `thrift:"resultLinks,1282" db:"resultLinks" json:"resultLinks,omitempty"` + StartRowOffset int64 `thrift:"startRowOffset,1,required" db:"startRowOffset" json:"startRowOffset"` + Rows []*TRow `thrift:"rows,2,required" db:"rows" json:"rows"` + Columns []*TColumn `thrift:"columns,3" db:"columns" json:"columns,omitempty"` + BinaryColumns []byte `thrift:"binaryColumns,4" db:"binaryColumns" json:"binaryColumns,omitempty"` + ColumnCount *int32 `thrift:"columnCount,5" db:"columnCount" json:"columnCount,omitempty"` + // unused fields # 6 to 1280 + ArrowBatches []*TSparkArrowBatch `thrift:"arrowBatches,1281" db:"arrowBatches" json:"arrowBatches,omitempty"` + ResultLinks []*TSparkArrowResultLink `thrift:"resultLinks,1282" db:"resultLinks" json:"resultLinks,omitempty"` } func NewTRowSet() *TRowSet { - return &TRowSet{} + return &TRowSet{} } - func (p *TRowSet) GetStartRowOffset() int64 { - return p.StartRowOffset + return p.StartRowOffset } func (p *TRowSet) GetRows() []*TRow { - return p.Rows + return p.Rows } + var TRowSet_Columns_DEFAULT []*TColumn func (p *TRowSet) GetColumns() []*TColumn { - return p.Columns + return p.Columns } + var TRowSet_BinaryColumns_DEFAULT []byte func (p *TRowSet) GetBinaryColumns() []byte { - return p.BinaryColumns + return p.BinaryColumns } + var TRowSet_ColumnCount_DEFAULT int32 + func (p *TRowSet) GetColumnCount() int32 { - if !p.IsSetColumnCount() { - return TRowSet_ColumnCount_DEFAULT - } -return *p.ColumnCount + if !p.IsSetColumnCount() { + return TRowSet_ColumnCount_DEFAULT + } + return *p.ColumnCount } + var TRowSet_ArrowBatches_DEFAULT []*TSparkArrowBatch func (p *TRowSet) GetArrowBatches() []*TSparkArrowBatch { - return p.ArrowBatches + return p.ArrowBatches } + var TRowSet_ResultLinks_DEFAULT []*TSparkArrowResultLink func (p *TRowSet) GetResultLinks() []*TSparkArrowResultLink { - return p.ResultLinks + return p.ResultLinks } func (p *TRowSet) IsSetColumns() bool { - return p.Columns != nil + return p.Columns != nil } func (p *TRowSet) IsSetBinaryColumns() bool { - return p.BinaryColumns != nil + return p.BinaryColumns != nil } func (p *TRowSet) IsSetColumnCount() bool { - return p.ColumnCount != nil + return p.ColumnCount != nil } func (p *TRowSet) IsSetArrowBatches() bool { - return p.ArrowBatches != nil + return p.ArrowBatches != nil } func (p *TRowSet) IsSetResultLinks() bool { - return p.ResultLinks != nil + return p.ResultLinks != nil } func (p *TRowSet) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStartRowOffset bool = false; - var issetRows bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStartRowOffset = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.LIST { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetRows = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.LIST { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.I32 { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStartRowOffset{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartRowOffset is not set")); - } - if !issetRows{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")); - } - return nil -} - -func (p *TRowSet) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.StartRowOffset = v -} - return nil -} - -func (p *TRowSet) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TRow, 0, size) - p.Rows = tSlice - for i := 0; i < size; i ++ { - _elem34 := &TRow{} - if err := _elem34.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem34), err) - } - p.Rows = append(p.Rows, _elem34) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TRowSet) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TColumn, 0, size) - p.Columns = tSlice - for i := 0; i < size; i ++ { - _elem35 := &TColumn{} - if err := _elem35.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) - } - p.Columns = append(p.Columns, _elem35) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TRowSet) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.BinaryColumns = v -} - return nil -} - -func (p *TRowSet) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.ColumnCount = &v -} - return nil -} - -func (p *TRowSet) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TSparkArrowBatch, 0, size) - p.ArrowBatches = tSlice - for i := 0; i < size; i ++ { - _elem36 := &TSparkArrowBatch{} - if err := _elem36.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem36), err) - } - p.ArrowBatches = append(p.ArrowBatches, _elem36) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TRowSet) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TSparkArrowResultLink, 0, size) - p.ResultLinks = tSlice - for i := 0; i < size; i ++ { - _elem37 := &TSparkArrowResultLink{} - if err := _elem37.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem37), err) - } - p.ResultLinks = append(p.ResultLinks, _elem37) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStartRowOffset bool = false + var issetRows bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStartRowOffset = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetRows = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStartRowOffset { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartRowOffset is not set")) + } + if !issetRows { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")) + } + return nil +} + +func (p *TRowSet) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.StartRowOffset = v + } + return nil +} + +func (p *TRowSet) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TRow, 0, size) + p.Rows = tSlice + for i := 0; i < size; i++ { + _elem34 := &TRow{} + if err := _elem34.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem34), err) + } + p.Rows = append(p.Rows, _elem34) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TRowSet) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TColumn, 0, size) + p.Columns = tSlice + for i := 0; i < size; i++ { + _elem35 := &TColumn{} + if err := _elem35.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) + } + p.Columns = append(p.Columns, _elem35) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TRowSet) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.BinaryColumns = v + } + return nil +} + +func (p *TRowSet) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.ColumnCount = &v + } + return nil +} + +func (p *TRowSet) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TSparkArrowBatch, 0, size) + p.ArrowBatches = tSlice + for i := 0; i < size; i++ { + _elem36 := &TSparkArrowBatch{} + if err := _elem36.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem36), err) + } + p.ArrowBatches = append(p.ArrowBatches, _elem36) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TRowSet) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TSparkArrowResultLink, 0, size) + p.ResultLinks = tSlice + for i := 0; i < size; i++ { + _elem37 := &TSparkArrowResultLink{} + if err := _elem37.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem37), err) + } + p.ResultLinks = append(p.ResultLinks, _elem37) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TRowSet) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TRowSet"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TRowSet"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TRowSet) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:startRowOffset: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.StartRowOffset)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:startRowOffset: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:startRowOffset: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.StartRowOffset)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:startRowOffset: ", p), err) + } + return err } func (p *TRowSet) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "rows", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Rows)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Rows { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rows: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "rows", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Rows)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Rows { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rows: ", p), err) + } + return err } func (p *TRowSet) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetColumns() { - if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:columns: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Columns)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Columns { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:columns: ", p), err) } - } - return err + if p.IsSetColumns() { + if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:columns: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Columns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Columns { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:columns: ", p), err) + } + } + return err } func (p *TRowSet) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBinaryColumns() { - if err := oprot.WriteFieldBegin(ctx, "binaryColumns", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:binaryColumns: ", p), err) } - if err := oprot.WriteBinary(ctx, p.BinaryColumns); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.binaryColumns (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:binaryColumns: ", p), err) } - } - return err + if p.IsSetBinaryColumns() { + if err := oprot.WriteFieldBegin(ctx, "binaryColumns", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:binaryColumns: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.BinaryColumns); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.binaryColumns (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:binaryColumns: ", p), err) + } + } + return err } func (p *TRowSet) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetColumnCount() { - if err := oprot.WriteFieldBegin(ctx, "columnCount", thrift.I32, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnCount: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.ColumnCount)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.columnCount (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnCount: ", p), err) } - } - return err + if p.IsSetColumnCount() { + if err := oprot.WriteFieldBegin(ctx, "columnCount", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnCount: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.ColumnCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.columnCount (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnCount: ", p), err) + } + } + return err } func (p *TRowSet) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArrowBatches() { - if err := oprot.WriteFieldBegin(ctx, "arrowBatches", thrift.LIST, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:arrowBatches: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ArrowBatches)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.ArrowBatches { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:arrowBatches: ", p), err) } - } - return err + if p.IsSetArrowBatches() { + if err := oprot.WriteFieldBegin(ctx, "arrowBatches", thrift.LIST, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:arrowBatches: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ArrowBatches)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ArrowBatches { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:arrowBatches: ", p), err) + } + } + return err } func (p *TRowSet) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResultLinks() { - if err := oprot.WriteFieldBegin(ctx, "resultLinks", thrift.LIST, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:resultLinks: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ResultLinks)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.ResultLinks { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:resultLinks: ", p), err) } - } - return err + if p.IsSetResultLinks() { + if err := oprot.WriteFieldBegin(ctx, "resultLinks", thrift.LIST, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:resultLinks: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ResultLinks)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ResultLinks { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:resultLinks: ", p), err) + } + } + return err } func (p *TRowSet) Equals(other *TRowSet) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.StartRowOffset != other.StartRowOffset { return false } - if len(p.Rows) != len(other.Rows) { return false } - for i, _tgt := range p.Rows { - _src38 := other.Rows[i] - if !_tgt.Equals(_src38) { return false } - } - if len(p.Columns) != len(other.Columns) { return false } - for i, _tgt := range p.Columns { - _src39 := other.Columns[i] - if !_tgt.Equals(_src39) { return false } - } - if bytes.Compare(p.BinaryColumns, other.BinaryColumns) != 0 { return false } - if p.ColumnCount != other.ColumnCount { - if p.ColumnCount == nil || other.ColumnCount == nil { - return false - } - if (*p.ColumnCount) != (*other.ColumnCount) { return false } - } - if len(p.ArrowBatches) != len(other.ArrowBatches) { return false } - for i, _tgt := range p.ArrowBatches { - _src40 := other.ArrowBatches[i] - if !_tgt.Equals(_src40) { return false } - } - if len(p.ResultLinks) != len(other.ResultLinks) { return false } - for i, _tgt := range p.ResultLinks { - _src41 := other.ResultLinks[i] - if !_tgt.Equals(_src41) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StartRowOffset != other.StartRowOffset { + return false + } + if len(p.Rows) != len(other.Rows) { + return false + } + for i, _tgt := range p.Rows { + _src38 := other.Rows[i] + if !_tgt.Equals(_src38) { + return false + } + } + if len(p.Columns) != len(other.Columns) { + return false + } + for i, _tgt := range p.Columns { + _src39 := other.Columns[i] + if !_tgt.Equals(_src39) { + return false + } + } + if bytes.Compare(p.BinaryColumns, other.BinaryColumns) != 0 { + return false + } + if p.ColumnCount != other.ColumnCount { + if p.ColumnCount == nil || other.ColumnCount == nil { + return false + } + if (*p.ColumnCount) != (*other.ColumnCount) { + return false + } + } + if len(p.ArrowBatches) != len(other.ArrowBatches) { + return false + } + for i, _tgt := range p.ArrowBatches { + _src40 := other.ArrowBatches[i] + if !_tgt.Equals(_src40) { + return false + } + } + if len(p.ResultLinks) != len(other.ResultLinks) { + return false + } + for i, _tgt := range p.ResultLinks { + _src41 := other.ResultLinks[i] + if !_tgt.Equals(_src41) { + return false + } + } + return true } func (p *TRowSet) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TRowSet(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TRowSet(%+v)", *p) } func (p *TRowSet) Validate() error { - return nil + return nil } + // Attributes: -// - StatusCode -// - InfoMessages -// - SqlState -// - ErrorCode -// - ErrorMessage -// - DisplayMessage -// - ErrorDetailsJson +// - StatusCode +// - InfoMessages +// - SqlState +// - ErrorCode +// - ErrorMessage +// - DisplayMessage +// - ErrorDetailsJson type TStatus struct { - StatusCode TStatusCode `thrift:"statusCode,1,required" db:"statusCode" json:"statusCode"` - InfoMessages []string `thrift:"infoMessages,2" db:"infoMessages" json:"infoMessages,omitempty"` - SqlState *string `thrift:"sqlState,3" db:"sqlState" json:"sqlState,omitempty"` - ErrorCode *int32 `thrift:"errorCode,4" db:"errorCode" json:"errorCode,omitempty"` - ErrorMessage *string `thrift:"errorMessage,5" db:"errorMessage" json:"errorMessage,omitempty"` - DisplayMessage *string `thrift:"displayMessage,6" db:"displayMessage" json:"displayMessage,omitempty"` - // unused fields # 7 to 1280 - ErrorDetailsJson *string `thrift:"errorDetailsJson,1281" db:"errorDetailsJson" json:"errorDetailsJson,omitempty"` + StatusCode TStatusCode `thrift:"statusCode,1,required" db:"statusCode" json:"statusCode"` + InfoMessages []string `thrift:"infoMessages,2" db:"infoMessages" json:"infoMessages,omitempty"` + SqlState *string `thrift:"sqlState,3" db:"sqlState" json:"sqlState,omitempty"` + ErrorCode *int32 `thrift:"errorCode,4" db:"errorCode" json:"errorCode,omitempty"` + ErrorMessage *string `thrift:"errorMessage,5" db:"errorMessage" json:"errorMessage,omitempty"` + DisplayMessage *string `thrift:"displayMessage,6" db:"displayMessage" json:"displayMessage,omitempty"` + // unused fields # 7 to 1280 + ErrorDetailsJson *string `thrift:"errorDetailsJson,1281" db:"errorDetailsJson" json:"errorDetailsJson,omitempty"` } func NewTStatus() *TStatus { - return &TStatus{} + return &TStatus{} } - func (p *TStatus) GetStatusCode() TStatusCode { - return p.StatusCode + return p.StatusCode } + var TStatus_InfoMessages_DEFAULT []string func (p *TStatus) GetInfoMessages() []string { - return p.InfoMessages + return p.InfoMessages } + var TStatus_SqlState_DEFAULT string + func (p *TStatus) GetSqlState() string { - if !p.IsSetSqlState() { - return TStatus_SqlState_DEFAULT - } -return *p.SqlState + if !p.IsSetSqlState() { + return TStatus_SqlState_DEFAULT + } + return *p.SqlState } + var TStatus_ErrorCode_DEFAULT int32 + func (p *TStatus) GetErrorCode() int32 { - if !p.IsSetErrorCode() { - return TStatus_ErrorCode_DEFAULT - } -return *p.ErrorCode + if !p.IsSetErrorCode() { + return TStatus_ErrorCode_DEFAULT + } + return *p.ErrorCode } + var TStatus_ErrorMessage_DEFAULT string + func (p *TStatus) GetErrorMessage() string { - if !p.IsSetErrorMessage() { - return TStatus_ErrorMessage_DEFAULT - } -return *p.ErrorMessage + if !p.IsSetErrorMessage() { + return TStatus_ErrorMessage_DEFAULT + } + return *p.ErrorMessage } + var TStatus_DisplayMessage_DEFAULT string + func (p *TStatus) GetDisplayMessage() string { - if !p.IsSetDisplayMessage() { - return TStatus_DisplayMessage_DEFAULT - } -return *p.DisplayMessage + if !p.IsSetDisplayMessage() { + return TStatus_DisplayMessage_DEFAULT + } + return *p.DisplayMessage } + var TStatus_ErrorDetailsJson_DEFAULT string + func (p *TStatus) GetErrorDetailsJson() string { - if !p.IsSetErrorDetailsJson() { - return TStatus_ErrorDetailsJson_DEFAULT - } -return *p.ErrorDetailsJson + if !p.IsSetErrorDetailsJson() { + return TStatus_ErrorDetailsJson_DEFAULT + } + return *p.ErrorDetailsJson } func (p *TStatus) IsSetInfoMessages() bool { - return p.InfoMessages != nil + return p.InfoMessages != nil } func (p *TStatus) IsSetSqlState() bool { - return p.SqlState != nil + return p.SqlState != nil } func (p *TStatus) IsSetErrorCode() bool { - return p.ErrorCode != nil + return p.ErrorCode != nil } func (p *TStatus) IsSetErrorMessage() bool { - return p.ErrorMessage != nil + return p.ErrorMessage != nil } func (p *TStatus) IsSetDisplayMessage() bool { - return p.DisplayMessage != nil + return p.DisplayMessage != nil } func (p *TStatus) IsSetErrorDetailsJson() bool { - return p.ErrorDetailsJson != nil + return p.ErrorDetailsJson != nil } func (p *TStatus) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatusCode bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatusCode = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.LIST { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I32 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRING { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatusCode{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StatusCode is not set")); - } - return nil -} - -func (p *TStatus) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TStatusCode(v) - p.StatusCode = temp -} - return nil -} - -func (p *TStatus) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]string, 0, size) - p.InfoMessages = tSlice - for i := 0; i < size; i ++ { -var _elem42 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem42 = v -} - p.InfoMessages = append(p.InfoMessages, _elem42) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TStatus) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.SqlState = &v -} - return nil -} - -func (p *TStatus) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.ErrorCode = &v -} - return nil -} - -func (p *TStatus) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.ErrorMessage = &v -} - return nil -} - -func (p *TStatus) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) -} else { - p.DisplayMessage = &v -} - return nil -} - -func (p *TStatus) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1281: ", err) -} else { - p.ErrorDetailsJson = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatusCode bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatusCode = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatusCode { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StatusCode is not set")) + } + return nil +} + +func (p *TStatus) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := TStatusCode(v) + p.StatusCode = temp + } + return nil +} + +func (p *TStatus) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.InfoMessages = tSlice + for i := 0; i < size; i++ { + var _elem42 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem42 = v + } + p.InfoMessages = append(p.InfoMessages, _elem42) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TStatus) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.SqlState = &v + } + return nil +} + +func (p *TStatus) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.ErrorCode = &v + } + return nil +} + +func (p *TStatus) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.ErrorMessage = &v + } + return nil +} + +func (p *TStatus) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.DisplayMessage = &v + } + return nil +} + +func (p *TStatus) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1281: ", err) + } else { + p.ErrorDetailsJson = &v + } + return nil } func (p *TStatus) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStatus"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TStatus"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField6(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TStatus) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "statusCode", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:statusCode: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.StatusCode)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.statusCode (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:statusCode: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "statusCode", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:statusCode: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.StatusCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.statusCode (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:statusCode: ", p), err) + } + return err } func (p *TStatus) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetInfoMessages() { - if err := oprot.WriteFieldBegin(ctx, "infoMessages", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoMessages: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.InfoMessages)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.InfoMessages { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoMessages: ", p), err) } - } - return err + if p.IsSetInfoMessages() { + if err := oprot.WriteFieldBegin(ctx, "infoMessages", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoMessages: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.InfoMessages)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.InfoMessages { + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoMessages: ", p), err) + } + } + return err } func (p *TStatus) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSqlState() { - if err := oprot.WriteFieldBegin(ctx, "sqlState", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SqlState)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) } - } - return err + if p.IsSetSqlState() { + if err := oprot.WriteFieldBegin(ctx, "sqlState", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.SqlState)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) + } + } + return err } func (p *TStatus) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorCode() { - if err := oprot.WriteFieldBegin(ctx, "errorCode", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.ErrorCode)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) } - } - return err + if p.IsSetErrorCode() { + if err := oprot.WriteFieldBegin(ctx, "errorCode", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) + } + } + return err } func (p *TStatus) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorMessage() { - if err := oprot.WriteFieldBegin(ctx, "errorMessage", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ErrorMessage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) } - } - return err + if p.IsSetErrorMessage() { + if err := oprot.WriteFieldBegin(ctx, "errorMessage", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.ErrorMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) + } + } + return err } func (p *TStatus) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDisplayMessage() { - if err := oprot.WriteFieldBegin(ctx, "displayMessage", thrift.STRING, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:displayMessage: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.DisplayMessage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.displayMessage (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:displayMessage: ", p), err) } - } - return err + if p.IsSetDisplayMessage() { + if err := oprot.WriteFieldBegin(ctx, "displayMessage", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:displayMessage: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.DisplayMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.displayMessage (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:displayMessage: ", p), err) + } + } + return err } func (p *TStatus) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorDetailsJson() { - if err := oprot.WriteFieldBegin(ctx, "errorDetailsJson", thrift.STRING, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:errorDetailsJson: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ErrorDetailsJson)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorDetailsJson (1281) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:errorDetailsJson: ", p), err) } - } - return err + if p.IsSetErrorDetailsJson() { + if err := oprot.WriteFieldBegin(ctx, "errorDetailsJson", thrift.STRING, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:errorDetailsJson: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.ErrorDetailsJson)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorDetailsJson (1281) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:errorDetailsJson: ", p), err) + } + } + return err } func (p *TStatus) Equals(other *TStatus) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.StatusCode != other.StatusCode { return false } - if len(p.InfoMessages) != len(other.InfoMessages) { return false } - for i, _tgt := range p.InfoMessages { - _src43 := other.InfoMessages[i] - if _tgt != _src43 { return false } - } - if p.SqlState != other.SqlState { - if p.SqlState == nil || other.SqlState == nil { - return false - } - if (*p.SqlState) != (*other.SqlState) { return false } - } - if p.ErrorCode != other.ErrorCode { - if p.ErrorCode == nil || other.ErrorCode == nil { - return false - } - if (*p.ErrorCode) != (*other.ErrorCode) { return false } - } - if p.ErrorMessage != other.ErrorMessage { - if p.ErrorMessage == nil || other.ErrorMessage == nil { - return false - } - if (*p.ErrorMessage) != (*other.ErrorMessage) { return false } - } - if p.DisplayMessage != other.DisplayMessage { - if p.DisplayMessage == nil || other.DisplayMessage == nil { - return false - } - if (*p.DisplayMessage) != (*other.DisplayMessage) { return false } - } - if p.ErrorDetailsJson != other.ErrorDetailsJson { - if p.ErrorDetailsJson == nil || other.ErrorDetailsJson == nil { - return false - } - if (*p.ErrorDetailsJson) != (*other.ErrorDetailsJson) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StatusCode != other.StatusCode { + return false + } + if len(p.InfoMessages) != len(other.InfoMessages) { + return false + } + for i, _tgt := range p.InfoMessages { + _src43 := other.InfoMessages[i] + if _tgt != _src43 { + return false + } + } + if p.SqlState != other.SqlState { + if p.SqlState == nil || other.SqlState == nil { + return false + } + if (*p.SqlState) != (*other.SqlState) { + return false + } + } + if p.ErrorCode != other.ErrorCode { + if p.ErrorCode == nil || other.ErrorCode == nil { + return false + } + if (*p.ErrorCode) != (*other.ErrorCode) { + return false + } + } + if p.ErrorMessage != other.ErrorMessage { + if p.ErrorMessage == nil || other.ErrorMessage == nil { + return false + } + if (*p.ErrorMessage) != (*other.ErrorMessage) { + return false + } + } + if p.DisplayMessage != other.DisplayMessage { + if p.DisplayMessage == nil || other.DisplayMessage == nil { + return false + } + if (*p.DisplayMessage) != (*other.DisplayMessage) { + return false + } + } + if p.ErrorDetailsJson != other.ErrorDetailsJson { + if p.ErrorDetailsJson == nil || other.ErrorDetailsJson == nil { + return false + } + if (*p.ErrorDetailsJson) != (*other.ErrorDetailsJson) { + return false + } + } + return true } func (p *TStatus) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TStatus(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TStatus(%+v)", *p) } func (p *TStatus) Validate() error { - return nil + return nil } + // Attributes: -// - CatalogName -// - SchemaName +// - CatalogName +// - SchemaName type TNamespace struct { - CatalogName *TIdentifier `thrift:"catalogName,1" db:"catalogName" json:"catalogName,omitempty"` - SchemaName *TIdentifier `thrift:"schemaName,2" db:"schemaName" json:"schemaName,omitempty"` + CatalogName *TIdentifier `thrift:"catalogName,1" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TIdentifier `thrift:"schemaName,2" db:"schemaName" json:"schemaName,omitempty"` } func NewTNamespace() *TNamespace { - return &TNamespace{} + return &TNamespace{} } var TNamespace_CatalogName_DEFAULT TIdentifier + func (p *TNamespace) GetCatalogName() TIdentifier { - if !p.IsSetCatalogName() { - return TNamespace_CatalogName_DEFAULT - } -return *p.CatalogName + if !p.IsSetCatalogName() { + return TNamespace_CatalogName_DEFAULT + } + return *p.CatalogName } + var TNamespace_SchemaName_DEFAULT TIdentifier + func (p *TNamespace) GetSchemaName() TIdentifier { - if !p.IsSetSchemaName() { - return TNamespace_SchemaName_DEFAULT - } -return *p.SchemaName + if !p.IsSetSchemaName() { + return TNamespace_SchemaName_DEFAULT + } + return *p.SchemaName } func (p *TNamespace) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TNamespace) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TNamespace) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TNamespace) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TIdentifier(v) - p.CatalogName = &temp -} - return nil -} - -func (p *TNamespace) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TIdentifier(v) - p.SchemaName = &temp -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TNamespace) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := TIdentifier(v) + p.CatalogName = &temp + } + return nil +} + +func (p *TNamespace) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TIdentifier(v) + p.SchemaName = &temp + } + return nil } func (p *TNamespace) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TNamespace"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TNamespace"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TNamespace) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:catalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:catalogName: ", p), err) } - } - return err + if p.IsSetCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:catalogName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.catalogName (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:catalogName: ", p), err) + } + } + return err } func (p *TNamespace) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schemaName: ", p), err) } - } - return err + if p.IsSetSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schemaName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schemaName (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schemaName: ", p), err) + } + } + return err } func (p *TNamespace) Equals(other *TNamespace) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { return false } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { + return false + } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { + return false + } + } + return true } func (p *TNamespace) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TNamespace(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TNamespace(%+v)", *p) } func (p *TNamespace) Validate() error { - return nil + return nil } + // Attributes: -// - GUID -// - Secret +// - GUID +// - Secret type THandleIdentifier struct { - GUID []byte `thrift:"guid,1,required" db:"guid" json:"guid"` - Secret []byte `thrift:"secret,2,required" db:"secret" json:"secret"` + GUID []byte `thrift:"guid,1,required" db:"guid" json:"guid"` + Secret []byte `thrift:"secret,2,required" db:"secret" json:"secret"` } func NewTHandleIdentifier() *THandleIdentifier { - return &THandleIdentifier{} + return &THandleIdentifier{} } - func (p *THandleIdentifier) GetGUID() []byte { - return p.GUID + return p.GUID } func (p *THandleIdentifier) GetSecret() []byte { - return p.Secret + return p.Secret } func (p *THandleIdentifier) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetGUID bool = false; - var issetSecret bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetGUID = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetSecret = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetGUID{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field GUID is not set")); - } - if !issetSecret{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Secret is not set")); - } - return nil -} - -func (p *THandleIdentifier) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.GUID = v -} - return nil -} - -func (p *THandleIdentifier) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Secret = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetGUID bool = false + var issetSecret bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetGUID = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetSecret = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetGUID { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field GUID is not set")) + } + if !issetSecret { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Secret is not set")) + } + return nil +} + +func (p *THandleIdentifier) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.GUID = v + } + return nil +} + +func (p *THandleIdentifier) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Secret = v + } + return nil } func (p *THandleIdentifier) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "THandleIdentifier"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "THandleIdentifier"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *THandleIdentifier) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "guid", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:guid: ", p), err) } - if err := oprot.WriteBinary(ctx, p.GUID); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.guid (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:guid: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "guid", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:guid: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.GUID); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.guid (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:guid: ", p), err) + } + return err } func (p *THandleIdentifier) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "secret", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:secret: ", p), err) } - if err := oprot.WriteBinary(ctx, p.Secret); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.secret (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:secret: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "secret", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:secret: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.Secret); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.secret (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:secret: ", p), err) + } + return err } func (p *THandleIdentifier) Equals(other *THandleIdentifier) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if bytes.Compare(p.GUID, other.GUID) != 0 { return false } - if bytes.Compare(p.Secret, other.Secret) != 0 { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.GUID, other.GUID) != 0 { + return false + } + if bytes.Compare(p.Secret, other.Secret) != 0 { + return false + } + return true } func (p *THandleIdentifier) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("THandleIdentifier(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("THandleIdentifier(%+v)", *p) } func (p *THandleIdentifier) Validate() error { - return nil + return nil } + // Attributes: -// - SessionId +// - SessionId type TSessionHandle struct { - SessionId *THandleIdentifier `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` + SessionId *THandleIdentifier `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` } func NewTSessionHandle() *TSessionHandle { - return &TSessionHandle{} + return &TSessionHandle{} } var TSessionHandle_SessionId_DEFAULT *THandleIdentifier + func (p *TSessionHandle) GetSessionId() *THandleIdentifier { - if !p.IsSetSessionId() { - return TSessionHandle_SessionId_DEFAULT - } -return p.SessionId + if !p.IsSetSessionId() { + return TSessionHandle_SessionId_DEFAULT + } + return p.SessionId } func (p *TSessionHandle) IsSetSessionId() bool { - return p.SessionId != nil + return p.SessionId != nil } func (p *TSessionHandle) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionId bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionId = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionId{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")); - } - return nil -} - -func (p *TSessionHandle) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionId = &THandleIdentifier{} - if err := p.SessionId.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionId), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionId bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionId = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionId { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) + } + return nil +} + +func (p *TSessionHandle) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionId = &THandleIdentifier{} + if err := p.SessionId.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionId), err) + } + return nil } func (p *TSessionHandle) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSessionHandle"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TSessionHandle"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TSessionHandle) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } - if err := p.SessionId.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionId), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) + } + if err := p.SessionId.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionId), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) + } + return err } func (p *TSessionHandle) Equals(other *TSessionHandle) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionId.Equals(other.SessionId) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionId.Equals(other.SessionId) { + return false + } + return true } func (p *TSessionHandle) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSessionHandle(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSessionHandle(%+v)", *p) } func (p *TSessionHandle) Validate() error { - return nil + return nil } + // Attributes: -// - OperationId -// - OperationType -// - HasResultSet -// - ModifiedRowCount +// - OperationId +// - OperationType +// - HasResultSet +// - ModifiedRowCount type TOperationHandle struct { - OperationId *THandleIdentifier `thrift:"operationId,1,required" db:"operationId" json:"operationId"` - OperationType TOperationType `thrift:"operationType,2,required" db:"operationType" json:"operationType"` - HasResultSet bool `thrift:"hasResultSet,3,required" db:"hasResultSet" json:"hasResultSet"` - ModifiedRowCount *float64 `thrift:"modifiedRowCount,4" db:"modifiedRowCount" json:"modifiedRowCount,omitempty"` + OperationId *THandleIdentifier `thrift:"operationId,1,required" db:"operationId" json:"operationId"` + OperationType TOperationType `thrift:"operationType,2,required" db:"operationType" json:"operationType"` + HasResultSet bool `thrift:"hasResultSet,3,required" db:"hasResultSet" json:"hasResultSet"` + ModifiedRowCount *float64 `thrift:"modifiedRowCount,4" db:"modifiedRowCount" json:"modifiedRowCount,omitempty"` } func NewTOperationHandle() *TOperationHandle { - return &TOperationHandle{} + return &TOperationHandle{} } var TOperationHandle_OperationId_DEFAULT *THandleIdentifier + func (p *TOperationHandle) GetOperationId() *THandleIdentifier { - if !p.IsSetOperationId() { - return TOperationHandle_OperationId_DEFAULT - } -return p.OperationId + if !p.IsSetOperationId() { + return TOperationHandle_OperationId_DEFAULT + } + return p.OperationId } func (p *TOperationHandle) GetOperationType() TOperationType { - return p.OperationType + return p.OperationType } func (p *TOperationHandle) GetHasResultSet() bool { - return p.HasResultSet + return p.HasResultSet } + var TOperationHandle_ModifiedRowCount_DEFAULT float64 + func (p *TOperationHandle) GetModifiedRowCount() float64 { - if !p.IsSetModifiedRowCount() { - return TOperationHandle_ModifiedRowCount_DEFAULT - } -return *p.ModifiedRowCount + if !p.IsSetModifiedRowCount() { + return TOperationHandle_ModifiedRowCount_DEFAULT + } + return *p.ModifiedRowCount } func (p *TOperationHandle) IsSetOperationId() bool { - return p.OperationId != nil + return p.OperationId != nil } func (p *TOperationHandle) IsSetModifiedRowCount() bool { - return p.ModifiedRowCount != nil + return p.ModifiedRowCount != nil } func (p *TOperationHandle) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationId bool = false; - var issetOperationType bool = false; - var issetHasResultSet bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperationId = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetOperationType = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetHasResultSet = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationId{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationId is not set")); - } - if !issetOperationType{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationType is not set")); - } - if !issetHasResultSet{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HasResultSet is not set")); - } - return nil -} - -func (p *TOperationHandle) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationId = &THandleIdentifier{} - if err := p.OperationId.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationId), err) - } - return nil -} - -func (p *TOperationHandle) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TOperationType(v) - p.OperationType = temp -} - return nil -} - -func (p *TOperationHandle) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.HasResultSet = v -} - return nil -} - -func (p *TOperationHandle) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.ModifiedRowCount = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperationId bool = false + var issetOperationType bool = false + var issetHasResultSet bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationId = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetOperationType = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetHasResultSet = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperationId { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationId is not set")) + } + if !issetOperationType { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationType is not set")) + } + if !issetHasResultSet { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HasResultSet is not set")) + } + return nil +} + +func (p *TOperationHandle) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationId = &THandleIdentifier{} + if err := p.OperationId.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationId), err) + } + return nil +} + +func (p *TOperationHandle) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TOperationType(v) + p.OperationType = temp + } + return nil +} + +func (p *TOperationHandle) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.HasResultSet = v + } + return nil +} + +func (p *TOperationHandle) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.ModifiedRowCount = &v + } + return nil } func (p *TOperationHandle) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TOperationHandle"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TOperationHandle"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TOperationHandle) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationId", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationId: ", p), err) } - if err := p.OperationId.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationId), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationId: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "operationId", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationId: ", p), err) + } + if err := p.OperationId.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationId), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationId: ", p), err) + } + return err } func (p *TOperationHandle) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationType", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationType: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.OperationType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationType (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationType: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "operationType", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationType: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.OperationType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationType (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationType: ", p), err) + } + return err } func (p *TOperationHandle) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "hasResultSet", thrift.BOOL, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hasResultSet: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.HasResultSet)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hasResultSet: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "hasResultSet", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hasResultSet: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.HasResultSet)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hasResultSet: ", p), err) + } + return err } func (p *TOperationHandle) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetModifiedRowCount() { - if err := oprot.WriteFieldBegin(ctx, "modifiedRowCount", thrift.DOUBLE, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:modifiedRowCount: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(*p.ModifiedRowCount)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.modifiedRowCount (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:modifiedRowCount: ", p), err) } - } - return err + if p.IsSetModifiedRowCount() { + if err := oprot.WriteFieldBegin(ctx, "modifiedRowCount", thrift.DOUBLE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:modifiedRowCount: ", p), err) + } + if err := oprot.WriteDouble(ctx, float64(*p.ModifiedRowCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.modifiedRowCount (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:modifiedRowCount: ", p), err) + } + } + return err } func (p *TOperationHandle) Equals(other *TOperationHandle) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationId.Equals(other.OperationId) { return false } - if p.OperationType != other.OperationType { return false } - if p.HasResultSet != other.HasResultSet { return false } - if p.ModifiedRowCount != other.ModifiedRowCount { - if p.ModifiedRowCount == nil || other.ModifiedRowCount == nil { - return false - } - if (*p.ModifiedRowCount) != (*other.ModifiedRowCount) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationId.Equals(other.OperationId) { + return false + } + if p.OperationType != other.OperationType { + return false + } + if p.HasResultSet != other.HasResultSet { + return false + } + if p.ModifiedRowCount != other.ModifiedRowCount { + if p.ModifiedRowCount == nil || other.ModifiedRowCount == nil { + return false + } + if (*p.ModifiedRowCount) != (*other.ModifiedRowCount) { + return false + } + } + return true } func (p *TOperationHandle) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TOperationHandle(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TOperationHandle(%+v)", *p) } func (p *TOperationHandle) Validate() error { - return nil + return nil } + // Attributes: -// - ClientProtocol -// - Username -// - Password -// - Configuration -// - GetInfos -// - ClientProtocolI64 -// - ConnectionProperties -// - InitialNamespace -// - CanUseMultipleCatalogs +// - ClientProtocol +// - Username +// - Password +// - Configuration +// - GetInfos +// - ClientProtocolI64 +// - ConnectionProperties +// - InitialNamespace +// - CanUseMultipleCatalogs type TOpenSessionReq struct { - ClientProtocol TProtocolVersion `thrift:"client_protocol,1" db:"client_protocol" json:"client_protocol"` - Username *string `thrift:"username,2" db:"username" json:"username,omitempty"` - Password *string `thrift:"password,3" db:"password" json:"password,omitempty"` - Configuration map[string]string `thrift:"configuration,4" db:"configuration" json:"configuration,omitempty"` - // unused fields # 5 to 1280 - GetInfos []TGetInfoType `thrift:"getInfos,1281" db:"getInfos" json:"getInfos,omitempty"` - ClientProtocolI64 *int64 `thrift:"client_protocol_i64,1282" db:"client_protocol_i64" json:"client_protocol_i64,omitempty"` - ConnectionProperties map[string]string `thrift:"connectionProperties,1283" db:"connectionProperties" json:"connectionProperties,omitempty"` - InitialNamespace *TNamespace `thrift:"initialNamespace,1284" db:"initialNamespace" json:"initialNamespace,omitempty"` - CanUseMultipleCatalogs *bool `thrift:"canUseMultipleCatalogs,1285" db:"canUseMultipleCatalogs" json:"canUseMultipleCatalogs,omitempty"` + ClientProtocol TProtocolVersion `thrift:"client_protocol,1" db:"client_protocol" json:"client_protocol"` + Username *string `thrift:"username,2" db:"username" json:"username,omitempty"` + Password *string `thrift:"password,3" db:"password" json:"password,omitempty"` + Configuration map[string]string `thrift:"configuration,4" db:"configuration" json:"configuration,omitempty"` + // unused fields # 5 to 1280 + GetInfos []TGetInfoType `thrift:"getInfos,1281" db:"getInfos" json:"getInfos,omitempty"` + ClientProtocolI64 *int64 `thrift:"client_protocol_i64,1282" db:"client_protocol_i64" json:"client_protocol_i64,omitempty"` + ConnectionProperties map[string]string `thrift:"connectionProperties,1283" db:"connectionProperties" json:"connectionProperties,omitempty"` + InitialNamespace *TNamespace `thrift:"initialNamespace,1284" db:"initialNamespace" json:"initialNamespace,omitempty"` + CanUseMultipleCatalogs *bool `thrift:"canUseMultipleCatalogs,1285" db:"canUseMultipleCatalogs" json:"canUseMultipleCatalogs,omitempty"` } func NewTOpenSessionReq() *TOpenSessionReq { - return &TOpenSessionReq{ -ClientProtocol: -7, -} + return &TOpenSessionReq{ + ClientProtocol: -7, + } } var TOpenSessionReq_ClientProtocol_DEFAULT TProtocolVersion = -7 func (p *TOpenSessionReq) GetClientProtocol() TProtocolVersion { - return p.ClientProtocol + return p.ClientProtocol } + var TOpenSessionReq_Username_DEFAULT string + func (p *TOpenSessionReq) GetUsername() string { - if !p.IsSetUsername() { - return TOpenSessionReq_Username_DEFAULT - } -return *p.Username + if !p.IsSetUsername() { + return TOpenSessionReq_Username_DEFAULT + } + return *p.Username } + var TOpenSessionReq_Password_DEFAULT string + func (p *TOpenSessionReq) GetPassword() string { - if !p.IsSetPassword() { - return TOpenSessionReq_Password_DEFAULT - } -return *p.Password + if !p.IsSetPassword() { + return TOpenSessionReq_Password_DEFAULT + } + return *p.Password } + var TOpenSessionReq_Configuration_DEFAULT map[string]string func (p *TOpenSessionReq) GetConfiguration() map[string]string { - return p.Configuration + return p.Configuration } + var TOpenSessionReq_GetInfos_DEFAULT []TGetInfoType func (p *TOpenSessionReq) GetGetInfos() []TGetInfoType { - return p.GetInfos + return p.GetInfos } + var TOpenSessionReq_ClientProtocolI64_DEFAULT int64 + func (p *TOpenSessionReq) GetClientProtocolI64() int64 { - if !p.IsSetClientProtocolI64() { - return TOpenSessionReq_ClientProtocolI64_DEFAULT - } -return *p.ClientProtocolI64 + if !p.IsSetClientProtocolI64() { + return TOpenSessionReq_ClientProtocolI64_DEFAULT + } + return *p.ClientProtocolI64 } + var TOpenSessionReq_ConnectionProperties_DEFAULT map[string]string func (p *TOpenSessionReq) GetConnectionProperties() map[string]string { - return p.ConnectionProperties + return p.ConnectionProperties } + var TOpenSessionReq_InitialNamespace_DEFAULT *TNamespace + func (p *TOpenSessionReq) GetInitialNamespace() *TNamespace { - if !p.IsSetInitialNamespace() { - return TOpenSessionReq_InitialNamespace_DEFAULT - } -return p.InitialNamespace + if !p.IsSetInitialNamespace() { + return TOpenSessionReq_InitialNamespace_DEFAULT + } + return p.InitialNamespace } + var TOpenSessionReq_CanUseMultipleCatalogs_DEFAULT bool + func (p *TOpenSessionReq) GetCanUseMultipleCatalogs() bool { - if !p.IsSetCanUseMultipleCatalogs() { - return TOpenSessionReq_CanUseMultipleCatalogs_DEFAULT - } -return *p.CanUseMultipleCatalogs + if !p.IsSetCanUseMultipleCatalogs() { + return TOpenSessionReq_CanUseMultipleCatalogs_DEFAULT + } + return *p.CanUseMultipleCatalogs } func (p *TOpenSessionReq) IsSetClientProtocol() bool { - return p.ClientProtocol != TOpenSessionReq_ClientProtocol_DEFAULT + return p.ClientProtocol != TOpenSessionReq_ClientProtocol_DEFAULT } func (p *TOpenSessionReq) IsSetUsername() bool { - return p.Username != nil + return p.Username != nil } func (p *TOpenSessionReq) IsSetPassword() bool { - return p.Password != nil + return p.Password != nil } func (p *TOpenSessionReq) IsSetConfiguration() bool { - return p.Configuration != nil + return p.Configuration != nil } func (p *TOpenSessionReq) IsSetGetInfos() bool { - return p.GetInfos != nil + return p.GetInfos != nil } func (p *TOpenSessionReq) IsSetClientProtocolI64() bool { - return p.ClientProtocolI64 != nil + return p.ClientProtocolI64 != nil } func (p *TOpenSessionReq) IsSetConnectionProperties() bool { - return p.ConnectionProperties != nil + return p.ConnectionProperties != nil } func (p *TOpenSessionReq) IsSetInitialNamespace() bool { - return p.InitialNamespace != nil + return p.InitialNamespace != nil } func (p *TOpenSessionReq) IsSetCanUseMultipleCatalogs() bool { - return p.CanUseMultipleCatalogs != nil + return p.CanUseMultipleCatalogs != nil } func (p *TOpenSessionReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.MAP { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1283: - if fieldTypeId == thrift.MAP { - if err := p.ReadField1283(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1284: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1284(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1285: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1285(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TOpenSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - temp := TProtocolVersion(v) - p.ClientProtocol = temp -} - return nil -} - -func (p *TOpenSessionReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Username = &v -} - return nil -} - -func (p *TOpenSessionReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.Password = &v -} - return nil -} - -func (p *TOpenSessionReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]string, size) - p.Configuration = tMap - for i := 0; i < size; i ++ { -var _key44 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key44 = v -} -var _val45 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _val45 = v -} - p.Configuration[_key44] = _val45 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TOpenSessionReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]TGetInfoType, 0, size) - p.GetInfos = tSlice - for i := 0; i < size; i ++ { -var _elem46 TGetInfoType - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - temp := TGetInfoType(v) - _elem46 = temp -} - p.GetInfos = append(p.GetInfos, _elem46) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TOpenSessionReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.ClientProtocolI64 = &v -} - return nil -} - -func (p *TOpenSessionReq) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]string, size) - p.ConnectionProperties = tMap - for i := 0; i < size; i ++ { -var _key47 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key47 = v -} -var _val48 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _val48 = v -} - p.ConnectionProperties[_key47] = _val48 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TOpenSessionReq) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { - p.InitialNamespace = &TNamespace{} - if err := p.InitialNamespace.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InitialNamespace), err) - } - return nil -} - -func (p *TOpenSessionReq) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1285: ", err) -} else { - p.CanUseMultipleCatalogs = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.MAP { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1283: + if fieldTypeId == thrift.MAP { + if err := p.ReadField1283(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1284: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1284(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1285: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1285(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TOpenSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + temp := TProtocolVersion(v) + p.ClientProtocol = temp + } + return nil +} + +func (p *TOpenSessionReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Username = &v + } + return nil +} + +func (p *TOpenSessionReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Password = &v + } + return nil +} + +func (p *TOpenSessionReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.Configuration = tMap + for i := 0; i < size; i++ { + var _key44 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key44 = v + } + var _val45 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val45 = v + } + p.Configuration[_key44] = _val45 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *TOpenSessionReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]TGetInfoType, 0, size) + p.GetInfos = tSlice + for i := 0; i < size; i++ { + var _elem46 TGetInfoType + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := TGetInfoType(v) + _elem46 = temp + } + p.GetInfos = append(p.GetInfos, _elem46) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TOpenSessionReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.ClientProtocolI64 = &v + } + return nil +} + +func (p *TOpenSessionReq) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.ConnectionProperties = tMap + for i := 0; i < size; i++ { + var _key47 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key47 = v + } + var _val48 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val48 = v + } + p.ConnectionProperties[_key47] = _val48 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *TOpenSessionReq) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { + p.InitialNamespace = &TNamespace{} + if err := p.InitialNamespace.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InitialNamespace), err) + } + return nil +} + +func (p *TOpenSessionReq) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1285: ", err) + } else { + p.CanUseMultipleCatalogs = &v + } + return nil } func (p *TOpenSessionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TOpenSessionReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - if err := p.writeField1283(ctx, oprot); err != nil { return err } - if err := p.writeField1284(ctx, oprot); err != nil { return err } - if err := p.writeField1285(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TOpenSessionReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + if err := p.writeField1283(ctx, oprot); err != nil { + return err + } + if err := p.writeField1284(ctx, oprot); err != nil { + return err + } + if err := p.writeField1285(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TOpenSessionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetClientProtocol() { - if err := oprot.WriteFieldBegin(ctx, "client_protocol", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:client_protocol: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.ClientProtocol)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.client_protocol (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_protocol: ", p), err) } - } - return err + if p.IsSetClientProtocol() { + if err := oprot.WriteFieldBegin(ctx, "client_protocol", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:client_protocol: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.ClientProtocol)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_protocol (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_protocol: ", p), err) + } + } + return err } func (p *TOpenSessionReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetUsername() { - if err := oprot.WriteFieldBegin(ctx, "username", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:username: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.Username)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.username (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:username: ", p), err) } - } - return err + if p.IsSetUsername() { + if err := oprot.WriteFieldBegin(ctx, "username", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:username: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.Username)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.username (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:username: ", p), err) + } + } + return err } func (p *TOpenSessionReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetPassword() { - if err := oprot.WriteFieldBegin(ctx, "password", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:password: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.Password)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.password (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:password: ", p), err) } - } - return err + if p.IsSetPassword() { + if err := oprot.WriteFieldBegin(ctx, "password", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:password: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.Password)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.password (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:password: ", p), err) + } + } + return err } func (p *TOpenSessionReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetConfiguration() { - if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.Configuration { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) } - } - return err + if p.IsSetConfiguration() { + if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) + } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Configuration { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) + } + } + return err } func (p *TOpenSessionReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetInfos() { - if err := oprot.WriteFieldBegin(ctx, "getInfos", thrift.LIST, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getInfos: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.GetInfos)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.GetInfos { - if err := oprot.WriteI32(ctx, int32(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getInfos: ", p), err) } - } - return err + if p.IsSetGetInfos() { + if err := oprot.WriteFieldBegin(ctx, "getInfos", thrift.LIST, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getInfos: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.GetInfos)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.GetInfos { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getInfos: ", p), err) + } + } + return err } func (p *TOpenSessionReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetClientProtocolI64() { - if err := oprot.WriteFieldBegin(ctx, "client_protocol_i64", thrift.I64, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:client_protocol_i64: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.ClientProtocolI64)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.client_protocol_i64 (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:client_protocol_i64: ", p), err) } - } - return err + if p.IsSetClientProtocolI64() { + if err := oprot.WriteFieldBegin(ctx, "client_protocol_i64", thrift.I64, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:client_protocol_i64: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.ClientProtocolI64)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_protocol_i64 (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:client_protocol_i64: ", p), err) + } + } + return err } func (p *TOpenSessionReq) writeField1283(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetConnectionProperties() { - if err := oprot.WriteFieldBegin(ctx, "connectionProperties", thrift.MAP, 1283); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:connectionProperties: ", p), err) } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.ConnectionProperties)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.ConnectionProperties { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:connectionProperties: ", p), err) } - } - return err + if p.IsSetConnectionProperties() { + if err := oprot.WriteFieldBegin(ctx, "connectionProperties", thrift.MAP, 1283); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:connectionProperties: ", p), err) + } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.ConnectionProperties)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.ConnectionProperties { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:connectionProperties: ", p), err) + } + } + return err } func (p *TOpenSessionReq) writeField1284(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetInitialNamespace() { - if err := oprot.WriteFieldBegin(ctx, "initialNamespace", thrift.STRUCT, 1284); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:initialNamespace: ", p), err) } - if err := p.InitialNamespace.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InitialNamespace), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:initialNamespace: ", p), err) } - } - return err + if p.IsSetInitialNamespace() { + if err := oprot.WriteFieldBegin(ctx, "initialNamespace", thrift.STRUCT, 1284); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:initialNamespace: ", p), err) + } + if err := p.InitialNamespace.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InitialNamespace), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:initialNamespace: ", p), err) + } + } + return err } func (p *TOpenSessionReq) writeField1285(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCanUseMultipleCatalogs() { - if err := oprot.WriteFieldBegin(ctx, "canUseMultipleCatalogs", thrift.BOOL, 1285); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:canUseMultipleCatalogs: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.CanUseMultipleCatalogs)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.canUseMultipleCatalogs (1285) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:canUseMultipleCatalogs: ", p), err) } - } - return err + if p.IsSetCanUseMultipleCatalogs() { + if err := oprot.WriteFieldBegin(ctx, "canUseMultipleCatalogs", thrift.BOOL, 1285); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:canUseMultipleCatalogs: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.CanUseMultipleCatalogs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.canUseMultipleCatalogs (1285) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:canUseMultipleCatalogs: ", p), err) + } + } + return err } func (p *TOpenSessionReq) Equals(other *TOpenSessionReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.ClientProtocol != other.ClientProtocol { return false } - if p.Username != other.Username { - if p.Username == nil || other.Username == nil { - return false - } - if (*p.Username) != (*other.Username) { return false } - } - if p.Password != other.Password { - if p.Password == nil || other.Password == nil { - return false - } - if (*p.Password) != (*other.Password) { return false } - } - if len(p.Configuration) != len(other.Configuration) { return false } - for k, _tgt := range p.Configuration { - _src49 := other.Configuration[k] - if _tgt != _src49 { return false } - } - if len(p.GetInfos) != len(other.GetInfos) { return false } - for i, _tgt := range p.GetInfos { - _src50 := other.GetInfos[i] - if _tgt != _src50 { return false } - } - if p.ClientProtocolI64 != other.ClientProtocolI64 { - if p.ClientProtocolI64 == nil || other.ClientProtocolI64 == nil { - return false - } - if (*p.ClientProtocolI64) != (*other.ClientProtocolI64) { return false } - } - if len(p.ConnectionProperties) != len(other.ConnectionProperties) { return false } - for k, _tgt := range p.ConnectionProperties { - _src51 := other.ConnectionProperties[k] - if _tgt != _src51 { return false } - } - if !p.InitialNamespace.Equals(other.InitialNamespace) { return false } - if p.CanUseMultipleCatalogs != other.CanUseMultipleCatalogs { - if p.CanUseMultipleCatalogs == nil || other.CanUseMultipleCatalogs == nil { - return false - } - if (*p.CanUseMultipleCatalogs) != (*other.CanUseMultipleCatalogs) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ClientProtocol != other.ClientProtocol { + return false + } + if p.Username != other.Username { + if p.Username == nil || other.Username == nil { + return false + } + if (*p.Username) != (*other.Username) { + return false + } + } + if p.Password != other.Password { + if p.Password == nil || other.Password == nil { + return false + } + if (*p.Password) != (*other.Password) { + return false + } + } + if len(p.Configuration) != len(other.Configuration) { + return false + } + for k, _tgt := range p.Configuration { + _src49 := other.Configuration[k] + if _tgt != _src49 { + return false + } + } + if len(p.GetInfos) != len(other.GetInfos) { + return false + } + for i, _tgt := range p.GetInfos { + _src50 := other.GetInfos[i] + if _tgt != _src50 { + return false + } + } + if p.ClientProtocolI64 != other.ClientProtocolI64 { + if p.ClientProtocolI64 == nil || other.ClientProtocolI64 == nil { + return false + } + if (*p.ClientProtocolI64) != (*other.ClientProtocolI64) { + return false + } + } + if len(p.ConnectionProperties) != len(other.ConnectionProperties) { + return false + } + for k, _tgt := range p.ConnectionProperties { + _src51 := other.ConnectionProperties[k] + if _tgt != _src51 { + return false + } + } + if !p.InitialNamespace.Equals(other.InitialNamespace) { + return false + } + if p.CanUseMultipleCatalogs != other.CanUseMultipleCatalogs { + if p.CanUseMultipleCatalogs == nil || other.CanUseMultipleCatalogs == nil { + return false + } + if (*p.CanUseMultipleCatalogs) != (*other.CanUseMultipleCatalogs) { + return false + } + } + return true } func (p *TOpenSessionReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TOpenSessionReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TOpenSessionReq(%+v)", *p) } func (p *TOpenSessionReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - ServerProtocolVersion -// - SessionHandle -// - Configuration -// - InitialNamespace -// - CanUseMultipleCatalogs -// - GetInfos +// - Status +// - ServerProtocolVersion +// - SessionHandle +// - Configuration +// - InitialNamespace +// - CanUseMultipleCatalogs +// - GetInfos type TOpenSessionResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - ServerProtocolVersion TProtocolVersion `thrift:"serverProtocolVersion,2,required" db:"serverProtocolVersion" json:"serverProtocolVersion"` - SessionHandle *TSessionHandle `thrift:"sessionHandle,3" db:"sessionHandle" json:"sessionHandle,omitempty"` - Configuration map[string]string `thrift:"configuration,4" db:"configuration" json:"configuration,omitempty"` - // unused fields # 5 to 1280 - GetInfos []*TGetInfoValue `thrift:"getInfos,1281" db:"getInfos" json:"getInfos,omitempty"` - // unused fields # 1282 to 1283 - InitialNamespace *TNamespace `thrift:"initialNamespace,1284" db:"initialNamespace" json:"initialNamespace,omitempty"` - CanUseMultipleCatalogs *bool `thrift:"canUseMultipleCatalogs,1285" db:"canUseMultipleCatalogs" json:"canUseMultipleCatalogs,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + ServerProtocolVersion TProtocolVersion `thrift:"serverProtocolVersion,2,required" db:"serverProtocolVersion" json:"serverProtocolVersion"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,3" db:"sessionHandle" json:"sessionHandle,omitempty"` + Configuration map[string]string `thrift:"configuration,4" db:"configuration" json:"configuration,omitempty"` + // unused fields # 5 to 1280 + GetInfos []*TGetInfoValue `thrift:"getInfos,1281" db:"getInfos" json:"getInfos,omitempty"` + // unused fields # 1282 to 1283 + InitialNamespace *TNamespace `thrift:"initialNamespace,1284" db:"initialNamespace" json:"initialNamespace,omitempty"` + CanUseMultipleCatalogs *bool `thrift:"canUseMultipleCatalogs,1285" db:"canUseMultipleCatalogs" json:"canUseMultipleCatalogs,omitempty"` } func NewTOpenSessionResp() *TOpenSessionResp { - return &TOpenSessionResp{} + return &TOpenSessionResp{} } var TOpenSessionResp_Status_DEFAULT *TStatus + func (p *TOpenSessionResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TOpenSessionResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TOpenSessionResp_Status_DEFAULT + } + return p.Status } func (p *TOpenSessionResp) GetServerProtocolVersion() TProtocolVersion { - return p.ServerProtocolVersion + return p.ServerProtocolVersion } + var TOpenSessionResp_SessionHandle_DEFAULT *TSessionHandle + func (p *TOpenSessionResp) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TOpenSessionResp_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TOpenSessionResp_SessionHandle_DEFAULT + } + return p.SessionHandle } + var TOpenSessionResp_Configuration_DEFAULT map[string]string func (p *TOpenSessionResp) GetConfiguration() map[string]string { - return p.Configuration + return p.Configuration } + var TOpenSessionResp_InitialNamespace_DEFAULT *TNamespace + func (p *TOpenSessionResp) GetInitialNamespace() *TNamespace { - if !p.IsSetInitialNamespace() { - return TOpenSessionResp_InitialNamespace_DEFAULT - } -return p.InitialNamespace + if !p.IsSetInitialNamespace() { + return TOpenSessionResp_InitialNamespace_DEFAULT + } + return p.InitialNamespace } + var TOpenSessionResp_CanUseMultipleCatalogs_DEFAULT bool + func (p *TOpenSessionResp) GetCanUseMultipleCatalogs() bool { - if !p.IsSetCanUseMultipleCatalogs() { - return TOpenSessionResp_CanUseMultipleCatalogs_DEFAULT - } -return *p.CanUseMultipleCatalogs + if !p.IsSetCanUseMultipleCatalogs() { + return TOpenSessionResp_CanUseMultipleCatalogs_DEFAULT + } + return *p.CanUseMultipleCatalogs } + var TOpenSessionResp_GetInfos_DEFAULT []*TGetInfoValue func (p *TOpenSessionResp) GetGetInfos() []*TGetInfoValue { - return p.GetInfos + return p.GetInfos } func (p *TOpenSessionResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TOpenSessionResp) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TOpenSessionResp) IsSetConfiguration() bool { - return p.Configuration != nil + return p.Configuration != nil } func (p *TOpenSessionResp) IsSetInitialNamespace() bool { - return p.InitialNamespace != nil + return p.InitialNamespace != nil } func (p *TOpenSessionResp) IsSetCanUseMultipleCatalogs() bool { - return p.CanUseMultipleCatalogs != nil + return p.CanUseMultipleCatalogs != nil } func (p *TOpenSessionResp) IsSetGetInfos() bool { - return p.GetInfos != nil + return p.GetInfos != nil } func (p *TOpenSessionResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - var issetServerProtocolVersion bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetServerProtocolVersion = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.MAP { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1284: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1284(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1285: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1285(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - if !issetServerProtocolVersion{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ServerProtocolVersion is not set")); - } - return nil -} - -func (p *TOpenSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TOpenSessionResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TProtocolVersion(v) - p.ServerProtocolVersion = temp -} - return nil -} - -func (p *TOpenSessionResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TOpenSessionResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]string, size) - p.Configuration = tMap - for i := 0; i < size; i ++ { -var _key52 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key52 = v -} -var _val53 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _val53 = v -} - p.Configuration[_key52] = _val53 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TOpenSessionResp) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { - p.InitialNamespace = &TNamespace{} - if err := p.InitialNamespace.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InitialNamespace), err) - } - return nil -} - -func (p *TOpenSessionResp) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1285: ", err) -} else { - p.CanUseMultipleCatalogs = &v -} - return nil -} - -func (p *TOpenSessionResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TGetInfoValue, 0, size) - p.GetInfos = tSlice - for i := 0; i < size; i ++ { - _elem54 := &TGetInfoValue{} - if err := _elem54.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem54), err) - } - p.GetInfos = append(p.GetInfos, _elem54) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + var issetServerProtocolVersion bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetServerProtocolVersion = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.MAP { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1284: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1284(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1285: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1285(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + if !issetServerProtocolVersion { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ServerProtocolVersion is not set")) + } + return nil +} + +func (p *TOpenSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TOpenSessionResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TProtocolVersion(v) + p.ServerProtocolVersion = temp + } + return nil +} + +func (p *TOpenSessionResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TOpenSessionResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.Configuration = tMap + for i := 0; i < size; i++ { + var _key52 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key52 = v + } + var _val53 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val53 = v + } + p.Configuration[_key52] = _val53 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *TOpenSessionResp) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { + p.InitialNamespace = &TNamespace{} + if err := p.InitialNamespace.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InitialNamespace), err) + } + return nil +} + +func (p *TOpenSessionResp) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1285: ", err) + } else { + p.CanUseMultipleCatalogs = &v + } + return nil +} + +func (p *TOpenSessionResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TGetInfoValue, 0, size) + p.GetInfos = tSlice + for i := 0; i < size; i++ { + _elem54 := &TGetInfoValue{} + if err := _elem54.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem54), err) + } + p.GetInfos = append(p.GetInfos, _elem54) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TOpenSessionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TOpenSessionResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1284(ctx, oprot); err != nil { return err } - if err := p.writeField1285(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TOpenSessionResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1284(ctx, oprot); err != nil { + return err + } + if err := p.writeField1285(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TOpenSessionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TOpenSessionResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "serverProtocolVersion", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:serverProtocolVersion: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.ServerProtocolVersion)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.serverProtocolVersion (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:serverProtocolVersion: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "serverProtocolVersion", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:serverProtocolVersion: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.ServerProtocolVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.serverProtocolVersion (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:serverProtocolVersion: ", p), err) + } + return err } func (p *TOpenSessionResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSessionHandle() { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessionHandle: ", p), err) } - } - return err + if p.IsSetSessionHandle() { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessionHandle: ", p), err) + } + } + return err } func (p *TOpenSessionResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetConfiguration() { - if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.Configuration { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) } - } - return err + if p.IsSetConfiguration() { + if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) + } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Configuration { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) + } + } + return err } func (p *TOpenSessionResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetInfos() { - if err := oprot.WriteFieldBegin(ctx, "getInfos", thrift.LIST, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getInfos: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.GetInfos)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.GetInfos { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getInfos: ", p), err) } - } - return err + if p.IsSetGetInfos() { + if err := oprot.WriteFieldBegin(ctx, "getInfos", thrift.LIST, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getInfos: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.GetInfos)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.GetInfos { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getInfos: ", p), err) + } + } + return err } func (p *TOpenSessionResp) writeField1284(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetInitialNamespace() { - if err := oprot.WriteFieldBegin(ctx, "initialNamespace", thrift.STRUCT, 1284); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:initialNamespace: ", p), err) } - if err := p.InitialNamespace.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InitialNamespace), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:initialNamespace: ", p), err) } - } - return err + if p.IsSetInitialNamespace() { + if err := oprot.WriteFieldBegin(ctx, "initialNamespace", thrift.STRUCT, 1284); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:initialNamespace: ", p), err) + } + if err := p.InitialNamespace.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InitialNamespace), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:initialNamespace: ", p), err) + } + } + return err } func (p *TOpenSessionResp) writeField1285(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCanUseMultipleCatalogs() { - if err := oprot.WriteFieldBegin(ctx, "canUseMultipleCatalogs", thrift.BOOL, 1285); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:canUseMultipleCatalogs: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.CanUseMultipleCatalogs)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.canUseMultipleCatalogs (1285) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:canUseMultipleCatalogs: ", p), err) } - } - return err + if p.IsSetCanUseMultipleCatalogs() { + if err := oprot.WriteFieldBegin(ctx, "canUseMultipleCatalogs", thrift.BOOL, 1285); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:canUseMultipleCatalogs: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.CanUseMultipleCatalogs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.canUseMultipleCatalogs (1285) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:canUseMultipleCatalogs: ", p), err) + } + } + return err } func (p *TOpenSessionResp) Equals(other *TOpenSessionResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if p.ServerProtocolVersion != other.ServerProtocolVersion { return false } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if len(p.Configuration) != len(other.Configuration) { return false } - for k, _tgt := range p.Configuration { - _src55 := other.Configuration[k] - if _tgt != _src55 { return false } - } - if len(p.GetInfos) != len(other.GetInfos) { return false } - for i, _tgt := range p.GetInfos { - _src56 := other.GetInfos[i] - if !_tgt.Equals(_src56) { return false } - } - if !p.InitialNamespace.Equals(other.InitialNamespace) { return false } - if p.CanUseMultipleCatalogs != other.CanUseMultipleCatalogs { - if p.CanUseMultipleCatalogs == nil || other.CanUseMultipleCatalogs == nil { - return false - } - if (*p.CanUseMultipleCatalogs) != (*other.CanUseMultipleCatalogs) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if p.ServerProtocolVersion != other.ServerProtocolVersion { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if len(p.Configuration) != len(other.Configuration) { + return false + } + for k, _tgt := range p.Configuration { + _src55 := other.Configuration[k] + if _tgt != _src55 { + return false + } + } + if len(p.GetInfos) != len(other.GetInfos) { + return false + } + for i, _tgt := range p.GetInfos { + _src56 := other.GetInfos[i] + if !_tgt.Equals(_src56) { + return false + } + } + if !p.InitialNamespace.Equals(other.InitialNamespace) { + return false + } + if p.CanUseMultipleCatalogs != other.CanUseMultipleCatalogs { + if p.CanUseMultipleCatalogs == nil || other.CanUseMultipleCatalogs == nil { + return false + } + if (*p.CanUseMultipleCatalogs) != (*other.CanUseMultipleCatalogs) { + return false + } + } + return true } func (p *TOpenSessionResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TOpenSessionResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TOpenSessionResp(%+v)", *p) } func (p *TOpenSessionResp) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle +// - SessionHandle type TCloseSessionReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` } func NewTCloseSessionReq() *TCloseSessionReq { - return &TCloseSessionReq{} + return &TCloseSessionReq{} } var TCloseSessionReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TCloseSessionReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TCloseSessionReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TCloseSessionReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TCloseSessionReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TCloseSessionReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - return nil -} - -func (p *TCloseSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + return nil +} + +func (p *TCloseSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil } func (p *TCloseSessionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCloseSessionReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TCloseSessionReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCloseSessionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TCloseSessionReq) Equals(other *TCloseSessionReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + return true } func (p *TCloseSessionReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCloseSessionReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCloseSessionReq(%+v)", *p) } func (p *TCloseSessionReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status +// - Status type TCloseSessionResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTCloseSessionResp() *TCloseSessionResp { - return &TCloseSessionResp{} + return &TCloseSessionResp{} } var TCloseSessionResp_Status_DEFAULT *TStatus + func (p *TCloseSessionResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCloseSessionResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TCloseSessionResp_Status_DEFAULT + } + return p.Status } func (p *TCloseSessionResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TCloseSessionResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TCloseSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TCloseSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil } func (p *TCloseSessionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCloseSessionResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TCloseSessionResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCloseSessionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TCloseSessionResp) Equals(other *TCloseSessionResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + return true } func (p *TCloseSessionResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCloseSessionResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCloseSessionResp(%+v)", *p) } func (p *TCloseSessionResp) Validate() error { - return nil + return nil } + // Attributes: -// - StringValue -// - SmallIntValue -// - IntegerBitmask -// - IntegerFlag -// - BinaryValue -// - LenValue +// - StringValue +// - SmallIntValue +// - IntegerBitmask +// - IntegerFlag +// - BinaryValue +// - LenValue type TGetInfoValue struct { - StringValue *string `thrift:"stringValue,1" db:"stringValue" json:"stringValue,omitempty"` - SmallIntValue *int16 `thrift:"smallIntValue,2" db:"smallIntValue" json:"smallIntValue,omitempty"` - IntegerBitmask *int32 `thrift:"integerBitmask,3" db:"integerBitmask" json:"integerBitmask,omitempty"` - IntegerFlag *int32 `thrift:"integerFlag,4" db:"integerFlag" json:"integerFlag,omitempty"` - BinaryValue *int32 `thrift:"binaryValue,5" db:"binaryValue" json:"binaryValue,omitempty"` - LenValue *int64 `thrift:"lenValue,6" db:"lenValue" json:"lenValue,omitempty"` + StringValue *string `thrift:"stringValue,1" db:"stringValue" json:"stringValue,omitempty"` + SmallIntValue *int16 `thrift:"smallIntValue,2" db:"smallIntValue" json:"smallIntValue,omitempty"` + IntegerBitmask *int32 `thrift:"integerBitmask,3" db:"integerBitmask" json:"integerBitmask,omitempty"` + IntegerFlag *int32 `thrift:"integerFlag,4" db:"integerFlag" json:"integerFlag,omitempty"` + BinaryValue *int32 `thrift:"binaryValue,5" db:"binaryValue" json:"binaryValue,omitempty"` + LenValue *int64 `thrift:"lenValue,6" db:"lenValue" json:"lenValue,omitempty"` } func NewTGetInfoValue() *TGetInfoValue { - return &TGetInfoValue{} + return &TGetInfoValue{} } var TGetInfoValue_StringValue_DEFAULT string + func (p *TGetInfoValue) GetStringValue() string { - if !p.IsSetStringValue() { - return TGetInfoValue_StringValue_DEFAULT - } -return *p.StringValue + if !p.IsSetStringValue() { + return TGetInfoValue_StringValue_DEFAULT + } + return *p.StringValue } + var TGetInfoValue_SmallIntValue_DEFAULT int16 + func (p *TGetInfoValue) GetSmallIntValue() int16 { - if !p.IsSetSmallIntValue() { - return TGetInfoValue_SmallIntValue_DEFAULT - } -return *p.SmallIntValue + if !p.IsSetSmallIntValue() { + return TGetInfoValue_SmallIntValue_DEFAULT + } + return *p.SmallIntValue } + var TGetInfoValue_IntegerBitmask_DEFAULT int32 + func (p *TGetInfoValue) GetIntegerBitmask() int32 { - if !p.IsSetIntegerBitmask() { - return TGetInfoValue_IntegerBitmask_DEFAULT - } -return *p.IntegerBitmask + if !p.IsSetIntegerBitmask() { + return TGetInfoValue_IntegerBitmask_DEFAULT + } + return *p.IntegerBitmask } + var TGetInfoValue_IntegerFlag_DEFAULT int32 + func (p *TGetInfoValue) GetIntegerFlag() int32 { - if !p.IsSetIntegerFlag() { - return TGetInfoValue_IntegerFlag_DEFAULT - } -return *p.IntegerFlag + if !p.IsSetIntegerFlag() { + return TGetInfoValue_IntegerFlag_DEFAULT + } + return *p.IntegerFlag } + var TGetInfoValue_BinaryValue_DEFAULT int32 + func (p *TGetInfoValue) GetBinaryValue() int32 { - if !p.IsSetBinaryValue() { - return TGetInfoValue_BinaryValue_DEFAULT - } -return *p.BinaryValue + if !p.IsSetBinaryValue() { + return TGetInfoValue_BinaryValue_DEFAULT + } + return *p.BinaryValue } + var TGetInfoValue_LenValue_DEFAULT int64 + func (p *TGetInfoValue) GetLenValue() int64 { - if !p.IsSetLenValue() { - return TGetInfoValue_LenValue_DEFAULT - } -return *p.LenValue + if !p.IsSetLenValue() { + return TGetInfoValue_LenValue_DEFAULT + } + return *p.LenValue } func (p *TGetInfoValue) CountSetFieldsTGetInfoValue() int { - count := 0 - if (p.IsSetStringValue()) { - count++ - } - if (p.IsSetSmallIntValue()) { - count++ - } - if (p.IsSetIntegerBitmask()) { - count++ - } - if (p.IsSetIntegerFlag()) { - count++ - } - if (p.IsSetBinaryValue()) { - count++ - } - if (p.IsSetLenValue()) { - count++ - } - return count + count := 0 + if p.IsSetStringValue() { + count++ + } + if p.IsSetSmallIntValue() { + count++ + } + if p.IsSetIntegerBitmask() { + count++ + } + if p.IsSetIntegerFlag() { + count++ + } + if p.IsSetBinaryValue() { + count++ + } + if p.IsSetLenValue() { + count++ + } + return count } func (p *TGetInfoValue) IsSetStringValue() bool { - return p.StringValue != nil + return p.StringValue != nil } func (p *TGetInfoValue) IsSetSmallIntValue() bool { - return p.SmallIntValue != nil + return p.SmallIntValue != nil } func (p *TGetInfoValue) IsSetIntegerBitmask() bool { - return p.IntegerBitmask != nil + return p.IntegerBitmask != nil } func (p *TGetInfoValue) IsSetIntegerFlag() bool { - return p.IntegerFlag != nil + return p.IntegerFlag != nil } func (p *TGetInfoValue) IsSetBinaryValue() bool { - return p.BinaryValue != nil + return p.BinaryValue != nil } func (p *TGetInfoValue) IsSetLenValue() bool { - return p.LenValue != nil + return p.LenValue != nil } func (p *TGetInfoValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I16 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I32 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I32 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.I32 { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.I64 { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TGetInfoValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.StringValue = &v -} - return nil -} - -func (p *TGetInfoValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.SmallIntValue = &v -} - return nil -} - -func (p *TGetInfoValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.IntegerBitmask = &v -} - return nil -} - -func (p *TGetInfoValue) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.IntegerFlag = &v -} - return nil -} - -func (p *TGetInfoValue) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.BinaryValue = &v -} - return nil -} - -func (p *TGetInfoValue) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) -} else { - p.LenValue = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I16 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TGetInfoValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.StringValue = &v + } + return nil +} + +func (p *TGetInfoValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.SmallIntValue = &v + } + return nil +} + +func (p *TGetInfoValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.IntegerBitmask = &v + } + return nil +} + +func (p *TGetInfoValue) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.IntegerFlag = &v + } + return nil +} + +func (p *TGetInfoValue) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.BinaryValue = &v + } + return nil +} + +func (p *TGetInfoValue) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.LenValue = &v + } + return nil } func (p *TGetInfoValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTGetInfoValue(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TGetInfoValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if c := p.CountSetFieldsTGetInfoValue(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TGetInfoValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField6(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetInfoValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringValue() { - if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:stringValue: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.stringValue (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:stringValue: ", p), err) } - } - return err + if p.IsSetStringValue() { + if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:stringValue: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stringValue (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:stringValue: ", p), err) + } + } + return err } func (p *TGetInfoValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSmallIntValue() { - if err := oprot.WriteFieldBegin(ctx, "smallIntValue", thrift.I16, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:smallIntValue: ", p), err) } - if err := oprot.WriteI16(ctx, int16(*p.SmallIntValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.smallIntValue (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:smallIntValue: ", p), err) } - } - return err + if p.IsSetSmallIntValue() { + if err := oprot.WriteFieldBegin(ctx, "smallIntValue", thrift.I16, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:smallIntValue: ", p), err) + } + if err := oprot.WriteI16(ctx, int16(*p.SmallIntValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.smallIntValue (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:smallIntValue: ", p), err) + } + } + return err } func (p *TGetInfoValue) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetIntegerBitmask() { - if err := oprot.WriteFieldBegin(ctx, "integerBitmask", thrift.I32, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:integerBitmask: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.IntegerBitmask)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.integerBitmask (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:integerBitmask: ", p), err) } - } - return err + if p.IsSetIntegerBitmask() { + if err := oprot.WriteFieldBegin(ctx, "integerBitmask", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:integerBitmask: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.IntegerBitmask)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.integerBitmask (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:integerBitmask: ", p), err) + } + } + return err } func (p *TGetInfoValue) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetIntegerFlag() { - if err := oprot.WriteFieldBegin(ctx, "integerFlag", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:integerFlag: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.IntegerFlag)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.integerFlag (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:integerFlag: ", p), err) } - } - return err + if p.IsSetIntegerFlag() { + if err := oprot.WriteFieldBegin(ctx, "integerFlag", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:integerFlag: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.IntegerFlag)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.integerFlag (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:integerFlag: ", p), err) + } + } + return err } func (p *TGetInfoValue) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBinaryValue() { - if err := oprot.WriteFieldBegin(ctx, "binaryValue", thrift.I32, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:binaryValue: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.BinaryValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.binaryValue (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:binaryValue: ", p), err) } - } - return err + if p.IsSetBinaryValue() { + if err := oprot.WriteFieldBegin(ctx, "binaryValue", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:binaryValue: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.BinaryValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.binaryValue (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:binaryValue: ", p), err) + } + } + return err } func (p *TGetInfoValue) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetLenValue() { - if err := oprot.WriteFieldBegin(ctx, "lenValue", thrift.I64, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:lenValue: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.LenValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.lenValue (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:lenValue: ", p), err) } - } - return err + if p.IsSetLenValue() { + if err := oprot.WriteFieldBegin(ctx, "lenValue", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:lenValue: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.LenValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.lenValue (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:lenValue: ", p), err) + } + } + return err } func (p *TGetInfoValue) Equals(other *TGetInfoValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.StringValue != other.StringValue { - if p.StringValue == nil || other.StringValue == nil { - return false - } - if (*p.StringValue) != (*other.StringValue) { return false } - } - if p.SmallIntValue != other.SmallIntValue { - if p.SmallIntValue == nil || other.SmallIntValue == nil { - return false - } - if (*p.SmallIntValue) != (*other.SmallIntValue) { return false } - } - if p.IntegerBitmask != other.IntegerBitmask { - if p.IntegerBitmask == nil || other.IntegerBitmask == nil { - return false - } - if (*p.IntegerBitmask) != (*other.IntegerBitmask) { return false } - } - if p.IntegerFlag != other.IntegerFlag { - if p.IntegerFlag == nil || other.IntegerFlag == nil { - return false - } - if (*p.IntegerFlag) != (*other.IntegerFlag) { return false } - } - if p.BinaryValue != other.BinaryValue { - if p.BinaryValue == nil || other.BinaryValue == nil { - return false - } - if (*p.BinaryValue) != (*other.BinaryValue) { return false } - } - if p.LenValue != other.LenValue { - if p.LenValue == nil || other.LenValue == nil { - return false - } - if (*p.LenValue) != (*other.LenValue) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StringValue != other.StringValue { + if p.StringValue == nil || other.StringValue == nil { + return false + } + if (*p.StringValue) != (*other.StringValue) { + return false + } + } + if p.SmallIntValue != other.SmallIntValue { + if p.SmallIntValue == nil || other.SmallIntValue == nil { + return false + } + if (*p.SmallIntValue) != (*other.SmallIntValue) { + return false + } + } + if p.IntegerBitmask != other.IntegerBitmask { + if p.IntegerBitmask == nil || other.IntegerBitmask == nil { + return false + } + if (*p.IntegerBitmask) != (*other.IntegerBitmask) { + return false + } + } + if p.IntegerFlag != other.IntegerFlag { + if p.IntegerFlag == nil || other.IntegerFlag == nil { + return false + } + if (*p.IntegerFlag) != (*other.IntegerFlag) { + return false + } + } + if p.BinaryValue != other.BinaryValue { + if p.BinaryValue == nil || other.BinaryValue == nil { + return false + } + if (*p.BinaryValue) != (*other.BinaryValue) { + return false + } + } + if p.LenValue != other.LenValue { + if p.LenValue == nil || other.LenValue == nil { + return false + } + if (*p.LenValue) != (*other.LenValue) { + return false + } + } + return true } func (p *TGetInfoValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetInfoValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetInfoValue(%+v)", *p) } func (p *TGetInfoValue) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - InfoType +// - SessionHandle +// - InfoType type TGetInfoReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - InfoType TGetInfoType `thrift:"infoType,2,required" db:"infoType" json:"infoType"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + InfoType TGetInfoType `thrift:"infoType,2,required" db:"infoType" json:"infoType"` } func NewTGetInfoReq() *TGetInfoReq { - return &TGetInfoReq{} + return &TGetInfoReq{} } var TGetInfoReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetInfoReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetInfoReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetInfoReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TGetInfoReq) GetInfoType() TGetInfoType { - return p.InfoType + return p.InfoType } func (p *TGetInfoReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetInfoReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - var issetInfoType bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetInfoType = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - if !issetInfoType{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field InfoType is not set")); - } - return nil -} - -func (p *TGetInfoReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetInfoReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TGetInfoType(v) - p.InfoType = temp -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + var issetInfoType bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetInfoType = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + if !issetInfoType { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field InfoType is not set")) + } + return nil +} + +func (p *TGetInfoReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetInfoReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TGetInfoType(v) + p.InfoType = temp + } + return nil } func (p *TGetInfoReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetInfoReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetInfoReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TGetInfoReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "infoType", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoType: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.InfoType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.infoType (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoType: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "infoType", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoType: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.InfoType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.infoType (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoType: ", p), err) + } + return err } func (p *TGetInfoReq) Equals(other *TGetInfoReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.InfoType != other.InfoType { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if p.InfoType != other.InfoType { + return false + } + return true } func (p *TGetInfoReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetInfoReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetInfoReq(%+v)", *p) } func (p *TGetInfoReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - InfoValue +// - Status +// - InfoValue type TGetInfoResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - InfoValue *TGetInfoValue `thrift:"infoValue,2,required" db:"infoValue" json:"infoValue"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + InfoValue *TGetInfoValue `thrift:"infoValue,2,required" db:"infoValue" json:"infoValue"` } func NewTGetInfoResp() *TGetInfoResp { - return &TGetInfoResp{} + return &TGetInfoResp{} } var TGetInfoResp_Status_DEFAULT *TStatus + func (p *TGetInfoResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetInfoResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetInfoResp_Status_DEFAULT + } + return p.Status } + var TGetInfoResp_InfoValue_DEFAULT *TGetInfoValue + func (p *TGetInfoResp) GetInfoValue() *TGetInfoValue { - if !p.IsSetInfoValue() { - return TGetInfoResp_InfoValue_DEFAULT - } -return p.InfoValue + if !p.IsSetInfoValue() { + return TGetInfoResp_InfoValue_DEFAULT + } + return p.InfoValue } func (p *TGetInfoResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetInfoResp) IsSetInfoValue() bool { - return p.InfoValue != nil + return p.InfoValue != nil } func (p *TGetInfoResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - var issetInfoValue bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetInfoValue = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - if !issetInfoValue{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field InfoValue is not set")); - } - return nil -} - -func (p *TGetInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.InfoValue = &TGetInfoValue{} - if err := p.InfoValue.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InfoValue), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + var issetInfoValue bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetInfoValue = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + if !issetInfoValue { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field InfoValue is not set")) + } + return nil +} + +func (p *TGetInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.InfoValue = &TGetInfoValue{} + if err := p.InfoValue.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InfoValue), err) + } + return nil } func (p *TGetInfoResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetInfoResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetInfoResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetInfoResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TGetInfoResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "infoValue", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoValue: ", p), err) } - if err := p.InfoValue.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InfoValue), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoValue: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "infoValue", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoValue: ", p), err) + } + if err := p.InfoValue.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InfoValue), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoValue: ", p), err) + } + return err } func (p *TGetInfoResp) Equals(other *TGetInfoResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.InfoValue.Equals(other.InfoValue) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if !p.InfoValue.Equals(other.InfoValue) { + return false + } + return true } func (p *TGetInfoResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetInfoResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetInfoResp(%+v)", *p) } func (p *TGetInfoResp) Validate() error { - return nil + return nil } + // Attributes: -// - MaxRows -// - MaxBytes +// - MaxRows +// - MaxBytes type TSparkGetDirectResults struct { - MaxRows int64 `thrift:"maxRows,1,required" db:"maxRows" json:"maxRows"` - MaxBytes *int64 `thrift:"maxBytes,2" db:"maxBytes" json:"maxBytes,omitempty"` + MaxRows int64 `thrift:"maxRows,1,required" db:"maxRows" json:"maxRows"` + MaxBytes *int64 `thrift:"maxBytes,2" db:"maxBytes" json:"maxBytes,omitempty"` } func NewTSparkGetDirectResults() *TSparkGetDirectResults { - return &TSparkGetDirectResults{} + return &TSparkGetDirectResults{} } - func (p *TSparkGetDirectResults) GetMaxRows() int64 { - return p.MaxRows + return p.MaxRows } + var TSparkGetDirectResults_MaxBytes_DEFAULT int64 + func (p *TSparkGetDirectResults) GetMaxBytes() int64 { - if !p.IsSetMaxBytes() { - return TSparkGetDirectResults_MaxBytes_DEFAULT - } -return *p.MaxBytes + if !p.IsSetMaxBytes() { + return TSparkGetDirectResults_MaxBytes_DEFAULT + } + return *p.MaxBytes } func (p *TSparkGetDirectResults) IsSetMaxBytes() bool { - return p.MaxBytes != nil + return p.MaxBytes != nil } func (p *TSparkGetDirectResults) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetMaxRows bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetMaxRows = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I64 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetMaxRows{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxRows is not set")); - } - return nil -} - -func (p *TSparkGetDirectResults) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.MaxRows = v -} - return nil -} - -func (p *TSparkGetDirectResults) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.MaxBytes = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetMaxRows bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetMaxRows = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetMaxRows { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxRows is not set")) + } + return nil +} + +func (p *TSparkGetDirectResults) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.MaxRows = v + } + return nil +} + +func (p *TSparkGetDirectResults) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.MaxBytes = &v + } + return nil } func (p *TSparkGetDirectResults) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkGetDirectResults"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkGetDirectResults"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TSparkGetDirectResults) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "maxRows", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:maxRows: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.MaxRows)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxRows (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:maxRows: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "maxRows", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:maxRows: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.MaxRows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxRows (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:maxRows: ", p), err) + } + return err } func (p *TSparkGetDirectResults) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetMaxBytes() { - if err := oprot.WriteFieldBegin(ctx, "maxBytes", thrift.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:maxBytes: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.MaxBytes)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxBytes (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:maxBytes: ", p), err) } - } - return err + if p.IsSetMaxBytes() { + if err := oprot.WriteFieldBegin(ctx, "maxBytes", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:maxBytes: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.MaxBytes)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxBytes (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:maxBytes: ", p), err) + } + } + return err } func (p *TSparkGetDirectResults) Equals(other *TSparkGetDirectResults) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.MaxRows != other.MaxRows { return false } - if p.MaxBytes != other.MaxBytes { - if p.MaxBytes == nil || other.MaxBytes == nil { - return false - } - if (*p.MaxBytes) != (*other.MaxBytes) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.MaxRows != other.MaxRows { + return false + } + if p.MaxBytes != other.MaxBytes { + if p.MaxBytes == nil || other.MaxBytes == nil { + return false + } + if (*p.MaxBytes) != (*other.MaxBytes) { + return false + } + } + return true } func (p *TSparkGetDirectResults) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkGetDirectResults(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkGetDirectResults(%+v)", *p) } func (p *TSparkGetDirectResults) Validate() error { - return nil + return nil } + // Attributes: -// - OperationStatus -// - ResultSetMetadata -// - ResultSet -// - CloseOperation +// - OperationStatus +// - ResultSetMetadata +// - ResultSet +// - CloseOperation type TSparkDirectResults struct { - OperationStatus *TGetOperationStatusResp `thrift:"operationStatus,1" db:"operationStatus" json:"operationStatus,omitempty"` - ResultSetMetadata *TGetResultSetMetadataResp `thrift:"resultSetMetadata,2" db:"resultSetMetadata" json:"resultSetMetadata,omitempty"` - ResultSet *TFetchResultsResp `thrift:"resultSet,3" db:"resultSet" json:"resultSet,omitempty"` - CloseOperation *TCloseOperationResp `thrift:"closeOperation,4" db:"closeOperation" json:"closeOperation,omitempty"` + OperationStatus *TGetOperationStatusResp `thrift:"operationStatus,1" db:"operationStatus" json:"operationStatus,omitempty"` + ResultSetMetadata *TGetResultSetMetadataResp `thrift:"resultSetMetadata,2" db:"resultSetMetadata" json:"resultSetMetadata,omitempty"` + ResultSet *TFetchResultsResp `thrift:"resultSet,3" db:"resultSet" json:"resultSet,omitempty"` + CloseOperation *TCloseOperationResp `thrift:"closeOperation,4" db:"closeOperation" json:"closeOperation,omitempty"` } func NewTSparkDirectResults() *TSparkDirectResults { - return &TSparkDirectResults{} + return &TSparkDirectResults{} } var TSparkDirectResults_OperationStatus_DEFAULT *TGetOperationStatusResp + func (p *TSparkDirectResults) GetOperationStatus() *TGetOperationStatusResp { - if !p.IsSetOperationStatus() { - return TSparkDirectResults_OperationStatus_DEFAULT - } -return p.OperationStatus + if !p.IsSetOperationStatus() { + return TSparkDirectResults_OperationStatus_DEFAULT + } + return p.OperationStatus } + var TSparkDirectResults_ResultSetMetadata_DEFAULT *TGetResultSetMetadataResp + func (p *TSparkDirectResults) GetResultSetMetadata() *TGetResultSetMetadataResp { - if !p.IsSetResultSetMetadata() { - return TSparkDirectResults_ResultSetMetadata_DEFAULT - } -return p.ResultSetMetadata + if !p.IsSetResultSetMetadata() { + return TSparkDirectResults_ResultSetMetadata_DEFAULT + } + return p.ResultSetMetadata } + var TSparkDirectResults_ResultSet_DEFAULT *TFetchResultsResp + func (p *TSparkDirectResults) GetResultSet() *TFetchResultsResp { - if !p.IsSetResultSet() { - return TSparkDirectResults_ResultSet_DEFAULT - } -return p.ResultSet + if !p.IsSetResultSet() { + return TSparkDirectResults_ResultSet_DEFAULT + } + return p.ResultSet } + var TSparkDirectResults_CloseOperation_DEFAULT *TCloseOperationResp + func (p *TSparkDirectResults) GetCloseOperation() *TCloseOperationResp { - if !p.IsSetCloseOperation() { - return TSparkDirectResults_CloseOperation_DEFAULT - } -return p.CloseOperation + if !p.IsSetCloseOperation() { + return TSparkDirectResults_CloseOperation_DEFAULT + } + return p.CloseOperation } func (p *TSparkDirectResults) IsSetOperationStatus() bool { - return p.OperationStatus != nil + return p.OperationStatus != nil } func (p *TSparkDirectResults) IsSetResultSetMetadata() bool { - return p.ResultSetMetadata != nil + return p.ResultSetMetadata != nil } func (p *TSparkDirectResults) IsSetResultSet() bool { - return p.ResultSet != nil + return p.ResultSet != nil } func (p *TSparkDirectResults) IsSetCloseOperation() bool { - return p.CloseOperation != nil + return p.CloseOperation != nil } func (p *TSparkDirectResults) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TSparkDirectResults) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationStatus = &TGetOperationStatusResp{} - if err := p.OperationStatus.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationStatus), err) - } - return nil -} - -func (p *TSparkDirectResults) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ResultSetMetadata = &TGetResultSetMetadataResp{} - if err := p.ResultSetMetadata.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ResultSetMetadata), err) - } - return nil -} - -func (p *TSparkDirectResults) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.ResultSet = &TFetchResultsResp{} - if err := p.ResultSet.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ResultSet), err) - } - return nil -} - -func (p *TSparkDirectResults) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.CloseOperation = &TCloseOperationResp{} - if err := p.CloseOperation.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CloseOperation), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TSparkDirectResults) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationStatus = &TGetOperationStatusResp{} + if err := p.OperationStatus.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationStatus), err) + } + return nil +} + +func (p *TSparkDirectResults) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.ResultSetMetadata = &TGetResultSetMetadataResp{} + if err := p.ResultSetMetadata.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ResultSetMetadata), err) + } + return nil +} + +func (p *TSparkDirectResults) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.ResultSet = &TFetchResultsResp{} + if err := p.ResultSet.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ResultSet), err) + } + return nil +} + +func (p *TSparkDirectResults) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.CloseOperation = &TCloseOperationResp{} + if err := p.CloseOperation.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CloseOperation), err) + } + return nil } func (p *TSparkDirectResults) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkDirectResults"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkDirectResults"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TSparkDirectResults) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationStatus() { - if err := oprot.WriteFieldBegin(ctx, "operationStatus", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationStatus: ", p), err) } - if err := p.OperationStatus.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationStatus), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationStatus: ", p), err) } - } - return err + if p.IsSetOperationStatus() { + if err := oprot.WriteFieldBegin(ctx, "operationStatus", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationStatus: ", p), err) + } + if err := p.OperationStatus.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationStatus), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationStatus: ", p), err) + } + } + return err } func (p *TSparkDirectResults) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResultSetMetadata() { - if err := oprot.WriteFieldBegin(ctx, "resultSetMetadata", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:resultSetMetadata: ", p), err) } - if err := p.ResultSetMetadata.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ResultSetMetadata), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:resultSetMetadata: ", p), err) } - } - return err + if p.IsSetResultSetMetadata() { + if err := oprot.WriteFieldBegin(ctx, "resultSetMetadata", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:resultSetMetadata: ", p), err) + } + if err := p.ResultSetMetadata.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ResultSetMetadata), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:resultSetMetadata: ", p), err) + } + } + return err } func (p *TSparkDirectResults) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResultSet() { - if err := oprot.WriteFieldBegin(ctx, "resultSet", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:resultSet: ", p), err) } - if err := p.ResultSet.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ResultSet), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:resultSet: ", p), err) } - } - return err + if p.IsSetResultSet() { + if err := oprot.WriteFieldBegin(ctx, "resultSet", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:resultSet: ", p), err) + } + if err := p.ResultSet.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ResultSet), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:resultSet: ", p), err) + } + } + return err } func (p *TSparkDirectResults) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCloseOperation() { - if err := oprot.WriteFieldBegin(ctx, "closeOperation", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:closeOperation: ", p), err) } - if err := p.CloseOperation.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CloseOperation), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:closeOperation: ", p), err) } - } - return err + if p.IsSetCloseOperation() { + if err := oprot.WriteFieldBegin(ctx, "closeOperation", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:closeOperation: ", p), err) + } + if err := p.CloseOperation.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CloseOperation), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:closeOperation: ", p), err) + } + } + return err } func (p *TSparkDirectResults) Equals(other *TSparkDirectResults) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationStatus.Equals(other.OperationStatus) { return false } - if !p.ResultSetMetadata.Equals(other.ResultSetMetadata) { return false } - if !p.ResultSet.Equals(other.ResultSet) { return false } - if !p.CloseOperation.Equals(other.CloseOperation) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationStatus.Equals(other.OperationStatus) { + return false + } + if !p.ResultSetMetadata.Equals(other.ResultSetMetadata) { + return false + } + if !p.ResultSet.Equals(other.ResultSet) { + return false + } + if !p.CloseOperation.Equals(other.CloseOperation) { + return false + } + return true } func (p *TSparkDirectResults) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkDirectResults(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkDirectResults(%+v)", *p) } func (p *TSparkDirectResults) Validate() error { - return nil + return nil } + // Attributes: -// - TimestampAsArrow -// - DecimalAsArrow -// - ComplexTypesAsArrow -// - IntervalTypesAsArrow -// - NullTypeAsArrow +// - TimestampAsArrow +// - DecimalAsArrow +// - ComplexTypesAsArrow +// - IntervalTypesAsArrow +// - NullTypeAsArrow type TSparkArrowTypes struct { - TimestampAsArrow *bool `thrift:"timestampAsArrow,1" db:"timestampAsArrow" json:"timestampAsArrow,omitempty"` - DecimalAsArrow *bool `thrift:"decimalAsArrow,2" db:"decimalAsArrow" json:"decimalAsArrow,omitempty"` - ComplexTypesAsArrow *bool `thrift:"complexTypesAsArrow,3" db:"complexTypesAsArrow" json:"complexTypesAsArrow,omitempty"` - IntervalTypesAsArrow *bool `thrift:"intervalTypesAsArrow,4" db:"intervalTypesAsArrow" json:"intervalTypesAsArrow,omitempty"` - NullTypeAsArrow *bool `thrift:"nullTypeAsArrow,5" db:"nullTypeAsArrow" json:"nullTypeAsArrow,omitempty"` + TimestampAsArrow *bool `thrift:"timestampAsArrow,1" db:"timestampAsArrow" json:"timestampAsArrow,omitempty"` + DecimalAsArrow *bool `thrift:"decimalAsArrow,2" db:"decimalAsArrow" json:"decimalAsArrow,omitempty"` + ComplexTypesAsArrow *bool `thrift:"complexTypesAsArrow,3" db:"complexTypesAsArrow" json:"complexTypesAsArrow,omitempty"` + IntervalTypesAsArrow *bool `thrift:"intervalTypesAsArrow,4" db:"intervalTypesAsArrow" json:"intervalTypesAsArrow,omitempty"` + NullTypeAsArrow *bool `thrift:"nullTypeAsArrow,5" db:"nullTypeAsArrow" json:"nullTypeAsArrow,omitempty"` } func NewTSparkArrowTypes() *TSparkArrowTypes { - return &TSparkArrowTypes{} + return &TSparkArrowTypes{} } var TSparkArrowTypes_TimestampAsArrow_DEFAULT bool + func (p *TSparkArrowTypes) GetTimestampAsArrow() bool { - if !p.IsSetTimestampAsArrow() { - return TSparkArrowTypes_TimestampAsArrow_DEFAULT - } -return *p.TimestampAsArrow + if !p.IsSetTimestampAsArrow() { + return TSparkArrowTypes_TimestampAsArrow_DEFAULT + } + return *p.TimestampAsArrow } + var TSparkArrowTypes_DecimalAsArrow_DEFAULT bool + func (p *TSparkArrowTypes) GetDecimalAsArrow() bool { - if !p.IsSetDecimalAsArrow() { - return TSparkArrowTypes_DecimalAsArrow_DEFAULT - } -return *p.DecimalAsArrow + if !p.IsSetDecimalAsArrow() { + return TSparkArrowTypes_DecimalAsArrow_DEFAULT + } + return *p.DecimalAsArrow } + var TSparkArrowTypes_ComplexTypesAsArrow_DEFAULT bool + func (p *TSparkArrowTypes) GetComplexTypesAsArrow() bool { - if !p.IsSetComplexTypesAsArrow() { - return TSparkArrowTypes_ComplexTypesAsArrow_DEFAULT - } -return *p.ComplexTypesAsArrow + if !p.IsSetComplexTypesAsArrow() { + return TSparkArrowTypes_ComplexTypesAsArrow_DEFAULT + } + return *p.ComplexTypesAsArrow } + var TSparkArrowTypes_IntervalTypesAsArrow_DEFAULT bool + func (p *TSparkArrowTypes) GetIntervalTypesAsArrow() bool { - if !p.IsSetIntervalTypesAsArrow() { - return TSparkArrowTypes_IntervalTypesAsArrow_DEFAULT - } -return *p.IntervalTypesAsArrow + if !p.IsSetIntervalTypesAsArrow() { + return TSparkArrowTypes_IntervalTypesAsArrow_DEFAULT + } + return *p.IntervalTypesAsArrow } + var TSparkArrowTypes_NullTypeAsArrow_DEFAULT bool + func (p *TSparkArrowTypes) GetNullTypeAsArrow() bool { - if !p.IsSetNullTypeAsArrow() { - return TSparkArrowTypes_NullTypeAsArrow_DEFAULT - } -return *p.NullTypeAsArrow + if !p.IsSetNullTypeAsArrow() { + return TSparkArrowTypes_NullTypeAsArrow_DEFAULT + } + return *p.NullTypeAsArrow } func (p *TSparkArrowTypes) IsSetTimestampAsArrow() bool { - return p.TimestampAsArrow != nil + return p.TimestampAsArrow != nil } func (p *TSparkArrowTypes) IsSetDecimalAsArrow() bool { - return p.DecimalAsArrow != nil + return p.DecimalAsArrow != nil } func (p *TSparkArrowTypes) IsSetComplexTypesAsArrow() bool { - return p.ComplexTypesAsArrow != nil + return p.ComplexTypesAsArrow != nil } func (p *TSparkArrowTypes) IsSetIntervalTypesAsArrow() bool { - return p.IntervalTypesAsArrow != nil + return p.IntervalTypesAsArrow != nil } func (p *TSparkArrowTypes) IsSetNullTypeAsArrow() bool { - return p.NullTypeAsArrow != nil + return p.NullTypeAsArrow != nil } func (p *TSparkArrowTypes) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TSparkArrowTypes) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.TimestampAsArrow = &v -} - return nil -} - -func (p *TSparkArrowTypes) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.DecimalAsArrow = &v -} - return nil -} - -func (p *TSparkArrowTypes) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.ComplexTypesAsArrow = &v -} - return nil -} - -func (p *TSparkArrowTypes) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.IntervalTypesAsArrow = &v -} - return nil -} - -func (p *TSparkArrowTypes) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.NullTypeAsArrow = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TSparkArrowTypes) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.TimestampAsArrow = &v + } + return nil +} + +func (p *TSparkArrowTypes) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.DecimalAsArrow = &v + } + return nil +} + +func (p *TSparkArrowTypes) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ComplexTypesAsArrow = &v + } + return nil +} + +func (p *TSparkArrowTypes) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.IntervalTypesAsArrow = &v + } + return nil +} + +func (p *TSparkArrowTypes) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.NullTypeAsArrow = &v + } + return nil } func (p *TSparkArrowTypes) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkArrowTypes"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkArrowTypes"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TSparkArrowTypes) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTimestampAsArrow() { - if err := oprot.WriteFieldBegin(ctx, "timestampAsArrow", thrift.BOOL, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:timestampAsArrow: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.TimestampAsArrow)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.timestampAsArrow (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:timestampAsArrow: ", p), err) } - } - return err + if p.IsSetTimestampAsArrow() { + if err := oprot.WriteFieldBegin(ctx, "timestampAsArrow", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:timestampAsArrow: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.TimestampAsArrow)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timestampAsArrow (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:timestampAsArrow: ", p), err) + } + } + return err } func (p *TSparkArrowTypes) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDecimalAsArrow() { - if err := oprot.WriteFieldBegin(ctx, "decimalAsArrow", thrift.BOOL, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:decimalAsArrow: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.DecimalAsArrow)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.decimalAsArrow (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:decimalAsArrow: ", p), err) } - } - return err + if p.IsSetDecimalAsArrow() { + if err := oprot.WriteFieldBegin(ctx, "decimalAsArrow", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:decimalAsArrow: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.DecimalAsArrow)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.decimalAsArrow (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:decimalAsArrow: ", p), err) + } + } + return err } func (p *TSparkArrowTypes) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetComplexTypesAsArrow() { - if err := oprot.WriteFieldBegin(ctx, "complexTypesAsArrow", thrift.BOOL, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:complexTypesAsArrow: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.ComplexTypesAsArrow)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.complexTypesAsArrow (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:complexTypesAsArrow: ", p), err) } - } - return err + if p.IsSetComplexTypesAsArrow() { + if err := oprot.WriteFieldBegin(ctx, "complexTypesAsArrow", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:complexTypesAsArrow: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.ComplexTypesAsArrow)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.complexTypesAsArrow (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:complexTypesAsArrow: ", p), err) + } + } + return err } func (p *TSparkArrowTypes) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetIntervalTypesAsArrow() { - if err := oprot.WriteFieldBegin(ctx, "intervalTypesAsArrow", thrift.BOOL, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:intervalTypesAsArrow: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.IntervalTypesAsArrow)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.intervalTypesAsArrow (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:intervalTypesAsArrow: ", p), err) } - } - return err + if p.IsSetIntervalTypesAsArrow() { + if err := oprot.WriteFieldBegin(ctx, "intervalTypesAsArrow", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:intervalTypesAsArrow: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.IntervalTypesAsArrow)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.intervalTypesAsArrow (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:intervalTypesAsArrow: ", p), err) + } + } + return err } func (p *TSparkArrowTypes) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetNullTypeAsArrow() { - if err := oprot.WriteFieldBegin(ctx, "nullTypeAsArrow", thrift.BOOL, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:nullTypeAsArrow: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.NullTypeAsArrow)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nullTypeAsArrow (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:nullTypeAsArrow: ", p), err) } - } - return err + if p.IsSetNullTypeAsArrow() { + if err := oprot.WriteFieldBegin(ctx, "nullTypeAsArrow", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:nullTypeAsArrow: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.NullTypeAsArrow)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nullTypeAsArrow (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:nullTypeAsArrow: ", p), err) + } + } + return err } func (p *TSparkArrowTypes) Equals(other *TSparkArrowTypes) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.TimestampAsArrow != other.TimestampAsArrow { - if p.TimestampAsArrow == nil || other.TimestampAsArrow == nil { - return false - } - if (*p.TimestampAsArrow) != (*other.TimestampAsArrow) { return false } - } - if p.DecimalAsArrow != other.DecimalAsArrow { - if p.DecimalAsArrow == nil || other.DecimalAsArrow == nil { - return false - } - if (*p.DecimalAsArrow) != (*other.DecimalAsArrow) { return false } - } - if p.ComplexTypesAsArrow != other.ComplexTypesAsArrow { - if p.ComplexTypesAsArrow == nil || other.ComplexTypesAsArrow == nil { - return false - } - if (*p.ComplexTypesAsArrow) != (*other.ComplexTypesAsArrow) { return false } - } - if p.IntervalTypesAsArrow != other.IntervalTypesAsArrow { - if p.IntervalTypesAsArrow == nil || other.IntervalTypesAsArrow == nil { - return false - } - if (*p.IntervalTypesAsArrow) != (*other.IntervalTypesAsArrow) { return false } - } - if p.NullTypeAsArrow != other.NullTypeAsArrow { - if p.NullTypeAsArrow == nil || other.NullTypeAsArrow == nil { - return false - } - if (*p.NullTypeAsArrow) != (*other.NullTypeAsArrow) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.TimestampAsArrow != other.TimestampAsArrow { + if p.TimestampAsArrow == nil || other.TimestampAsArrow == nil { + return false + } + if (*p.TimestampAsArrow) != (*other.TimestampAsArrow) { + return false + } + } + if p.DecimalAsArrow != other.DecimalAsArrow { + if p.DecimalAsArrow == nil || other.DecimalAsArrow == nil { + return false + } + if (*p.DecimalAsArrow) != (*other.DecimalAsArrow) { + return false + } + } + if p.ComplexTypesAsArrow != other.ComplexTypesAsArrow { + if p.ComplexTypesAsArrow == nil || other.ComplexTypesAsArrow == nil { + return false + } + if (*p.ComplexTypesAsArrow) != (*other.ComplexTypesAsArrow) { + return false + } + } + if p.IntervalTypesAsArrow != other.IntervalTypesAsArrow { + if p.IntervalTypesAsArrow == nil || other.IntervalTypesAsArrow == nil { + return false + } + if (*p.IntervalTypesAsArrow) != (*other.IntervalTypesAsArrow) { + return false + } + } + if p.NullTypeAsArrow != other.NullTypeAsArrow { + if p.NullTypeAsArrow == nil || other.NullTypeAsArrow == nil { + return false + } + if (*p.NullTypeAsArrow) != (*other.NullTypeAsArrow) { + return false + } + } + return true } func (p *TSparkArrowTypes) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkArrowTypes(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkArrowTypes(%+v)", *p) } func (p *TSparkArrowTypes) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - Statement -// - ConfOverlay -// - RunAsync -// - GetDirectResults -// - QueryTimeout -// - CanReadArrowResult_ -// - CanDownloadResult_ -// - CanDecompressLZ4Result_ -// - MaxBytesPerFile -// - UseArrowNativeTypes -// - ResultRowLimit -// - Parameters -// - MaxBytesPerBatch -// - StatementConf +// - SessionHandle +// - Statement +// - ConfOverlay +// - RunAsync +// - GetDirectResults +// - QueryTimeout +// - CanReadArrowResult_ +// - CanDownloadResult_ +// - CanDecompressLZ4Result_ +// - MaxBytesPerFile +// - UseArrowNativeTypes +// - ResultRowLimit +// - Parameters +// - MaxBytesPerBatch +// - StatementConf type TExecuteStatementReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - Statement string `thrift:"statement,2,required" db:"statement" json:"statement"` - ConfOverlay map[string]string `thrift:"confOverlay,3" db:"confOverlay" json:"confOverlay,omitempty"` - RunAsync bool `thrift:"runAsync,4" db:"runAsync" json:"runAsync"` - QueryTimeout int64 `thrift:"queryTimeout,5" db:"queryTimeout" json:"queryTimeout"` - // unused fields # 6 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - CanReadArrowResult_ *bool `thrift:"canReadArrowResult,1282" db:"canReadArrowResult" json:"canReadArrowResult,omitempty"` - CanDownloadResult_ *bool `thrift:"canDownloadResult,1283" db:"canDownloadResult" json:"canDownloadResult,omitempty"` - CanDecompressLZ4Result_ *bool `thrift:"canDecompressLZ4Result,1284" db:"canDecompressLZ4Result" json:"canDecompressLZ4Result,omitempty"` - MaxBytesPerFile *int64 `thrift:"maxBytesPerFile,1285" db:"maxBytesPerFile" json:"maxBytesPerFile,omitempty"` - UseArrowNativeTypes *TSparkArrowTypes `thrift:"useArrowNativeTypes,1286" db:"useArrowNativeTypes" json:"useArrowNativeTypes,omitempty"` - ResultRowLimit *int64 `thrift:"resultRowLimit,1287" db:"resultRowLimit" json:"resultRowLimit,omitempty"` - Parameters []*TSparkParameter `thrift:"parameters,1288" db:"parameters" json:"parameters,omitempty"` - MaxBytesPerBatch *int64 `thrift:"maxBytesPerBatch,1289" db:"maxBytesPerBatch" json:"maxBytesPerBatch,omitempty"` - // unused fields # 1290 to 1295 - StatementConf *TStatementConf `thrift:"statementConf,1296" db:"statementConf" json:"statementConf,omitempty"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + Statement string `thrift:"statement,2,required" db:"statement" json:"statement"` + ConfOverlay map[string]string `thrift:"confOverlay,3" db:"confOverlay" json:"confOverlay,omitempty"` + RunAsync bool `thrift:"runAsync,4" db:"runAsync" json:"runAsync"` + QueryTimeout int64 `thrift:"queryTimeout,5" db:"queryTimeout" json:"queryTimeout"` + // unused fields # 6 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + CanReadArrowResult_ *bool `thrift:"canReadArrowResult,1282" db:"canReadArrowResult" json:"canReadArrowResult,omitempty"` + CanDownloadResult_ *bool `thrift:"canDownloadResult,1283" db:"canDownloadResult" json:"canDownloadResult,omitempty"` + CanDecompressLZ4Result_ *bool `thrift:"canDecompressLZ4Result,1284" db:"canDecompressLZ4Result" json:"canDecompressLZ4Result,omitempty"` + MaxBytesPerFile *int64 `thrift:"maxBytesPerFile,1285" db:"maxBytesPerFile" json:"maxBytesPerFile,omitempty"` + UseArrowNativeTypes *TSparkArrowTypes `thrift:"useArrowNativeTypes,1286" db:"useArrowNativeTypes" json:"useArrowNativeTypes,omitempty"` + ResultRowLimit *int64 `thrift:"resultRowLimit,1287" db:"resultRowLimit" json:"resultRowLimit,omitempty"` + Parameters []*TSparkParameter `thrift:"parameters,1288" db:"parameters" json:"parameters,omitempty"` + MaxBytesPerBatch *int64 `thrift:"maxBytesPerBatch,1289" db:"maxBytesPerBatch" json:"maxBytesPerBatch,omitempty"` + // unused fields # 1290 to 1295 + StatementConf *TStatementConf `thrift:"statementConf,1296" db:"statementConf" json:"statementConf,omitempty"` } func NewTExecuteStatementReq() *TExecuteStatementReq { - return &TExecuteStatementReq{} + return &TExecuteStatementReq{} } var TExecuteStatementReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TExecuteStatementReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TExecuteStatementReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TExecuteStatementReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TExecuteStatementReq) GetStatement() string { - return p.Statement + return p.Statement } + var TExecuteStatementReq_ConfOverlay_DEFAULT map[string]string func (p *TExecuteStatementReq) GetConfOverlay() map[string]string { - return p.ConfOverlay + return p.ConfOverlay } + var TExecuteStatementReq_RunAsync_DEFAULT bool = false func (p *TExecuteStatementReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } + var TExecuteStatementReq_GetDirectResults_DEFAULT *TSparkGetDirectResults + func (p *TExecuteStatementReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TExecuteStatementReq_GetDirectResults_DEFAULT - } -return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TExecuteStatementReq_GetDirectResults_DEFAULT + } + return p.GetDirectResults } + var TExecuteStatementReq_QueryTimeout_DEFAULT int64 = 0 func (p *TExecuteStatementReq) GetQueryTimeout() int64 { - return p.QueryTimeout + return p.QueryTimeout } + var TExecuteStatementReq_CanReadArrowResult__DEFAULT bool + func (p *TExecuteStatementReq) GetCanReadArrowResult_() bool { - if !p.IsSetCanReadArrowResult_() { - return TExecuteStatementReq_CanReadArrowResult__DEFAULT - } -return *p.CanReadArrowResult_ + if !p.IsSetCanReadArrowResult_() { + return TExecuteStatementReq_CanReadArrowResult__DEFAULT + } + return *p.CanReadArrowResult_ } + var TExecuteStatementReq_CanDownloadResult__DEFAULT bool + func (p *TExecuteStatementReq) GetCanDownloadResult_() bool { - if !p.IsSetCanDownloadResult_() { - return TExecuteStatementReq_CanDownloadResult__DEFAULT - } -return *p.CanDownloadResult_ + if !p.IsSetCanDownloadResult_() { + return TExecuteStatementReq_CanDownloadResult__DEFAULT + } + return *p.CanDownloadResult_ } + var TExecuteStatementReq_CanDecompressLZ4Result__DEFAULT bool + func (p *TExecuteStatementReq) GetCanDecompressLZ4Result_() bool { - if !p.IsSetCanDecompressLZ4Result_() { - return TExecuteStatementReq_CanDecompressLZ4Result__DEFAULT - } -return *p.CanDecompressLZ4Result_ + if !p.IsSetCanDecompressLZ4Result_() { + return TExecuteStatementReq_CanDecompressLZ4Result__DEFAULT + } + return *p.CanDecompressLZ4Result_ } + var TExecuteStatementReq_MaxBytesPerFile_DEFAULT int64 + func (p *TExecuteStatementReq) GetMaxBytesPerFile() int64 { - if !p.IsSetMaxBytesPerFile() { - return TExecuteStatementReq_MaxBytesPerFile_DEFAULT - } -return *p.MaxBytesPerFile + if !p.IsSetMaxBytesPerFile() { + return TExecuteStatementReq_MaxBytesPerFile_DEFAULT + } + return *p.MaxBytesPerFile } + var TExecuteStatementReq_UseArrowNativeTypes_DEFAULT *TSparkArrowTypes + func (p *TExecuteStatementReq) GetUseArrowNativeTypes() *TSparkArrowTypes { - if !p.IsSetUseArrowNativeTypes() { - return TExecuteStatementReq_UseArrowNativeTypes_DEFAULT - } -return p.UseArrowNativeTypes + if !p.IsSetUseArrowNativeTypes() { + return TExecuteStatementReq_UseArrowNativeTypes_DEFAULT + } + return p.UseArrowNativeTypes } + var TExecuteStatementReq_ResultRowLimit_DEFAULT int64 + func (p *TExecuteStatementReq) GetResultRowLimit() int64 { - if !p.IsSetResultRowLimit() { - return TExecuteStatementReq_ResultRowLimit_DEFAULT - } -return *p.ResultRowLimit + if !p.IsSetResultRowLimit() { + return TExecuteStatementReq_ResultRowLimit_DEFAULT + } + return *p.ResultRowLimit } + var TExecuteStatementReq_Parameters_DEFAULT []*TSparkParameter func (p *TExecuteStatementReq) GetParameters() []*TSparkParameter { - return p.Parameters + return p.Parameters } + var TExecuteStatementReq_MaxBytesPerBatch_DEFAULT int64 + func (p *TExecuteStatementReq) GetMaxBytesPerBatch() int64 { - if !p.IsSetMaxBytesPerBatch() { - return TExecuteStatementReq_MaxBytesPerBatch_DEFAULT - } -return *p.MaxBytesPerBatch + if !p.IsSetMaxBytesPerBatch() { + return TExecuteStatementReq_MaxBytesPerBatch_DEFAULT + } + return *p.MaxBytesPerBatch } + var TExecuteStatementReq_StatementConf_DEFAULT *TStatementConf + func (p *TExecuteStatementReq) GetStatementConf() *TStatementConf { - if !p.IsSetStatementConf() { - return TExecuteStatementReq_StatementConf_DEFAULT - } -return p.StatementConf + if !p.IsSetStatementConf() { + return TExecuteStatementReq_StatementConf_DEFAULT + } + return p.StatementConf } func (p *TExecuteStatementReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TExecuteStatementReq) IsSetConfOverlay() bool { - return p.ConfOverlay != nil + return p.ConfOverlay != nil } func (p *TExecuteStatementReq) IsSetRunAsync() bool { - return p.RunAsync != TExecuteStatementReq_RunAsync_DEFAULT + return p.RunAsync != TExecuteStatementReq_RunAsync_DEFAULT } func (p *TExecuteStatementReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TExecuteStatementReq) IsSetQueryTimeout() bool { - return p.QueryTimeout != TExecuteStatementReq_QueryTimeout_DEFAULT + return p.QueryTimeout != TExecuteStatementReq_QueryTimeout_DEFAULT } func (p *TExecuteStatementReq) IsSetCanReadArrowResult_() bool { - return p.CanReadArrowResult_ != nil + return p.CanReadArrowResult_ != nil } func (p *TExecuteStatementReq) IsSetCanDownloadResult_() bool { - return p.CanDownloadResult_ != nil + return p.CanDownloadResult_ != nil } func (p *TExecuteStatementReq) IsSetCanDecompressLZ4Result_() bool { - return p.CanDecompressLZ4Result_ != nil + return p.CanDecompressLZ4Result_ != nil } func (p *TExecuteStatementReq) IsSetMaxBytesPerFile() bool { - return p.MaxBytesPerFile != nil + return p.MaxBytesPerFile != nil } func (p *TExecuteStatementReq) IsSetUseArrowNativeTypes() bool { - return p.UseArrowNativeTypes != nil + return p.UseArrowNativeTypes != nil } func (p *TExecuteStatementReq) IsSetResultRowLimit() bool { - return p.ResultRowLimit != nil + return p.ResultRowLimit != nil } func (p *TExecuteStatementReq) IsSetParameters() bool { - return p.Parameters != nil + return p.Parameters != nil } func (p *TExecuteStatementReq) IsSetMaxBytesPerBatch() bool { - return p.MaxBytesPerBatch != nil + return p.MaxBytesPerBatch != nil } func (p *TExecuteStatementReq) IsSetStatementConf() bool { - return p.StatementConf != nil + return p.StatementConf != nil } func (p *TExecuteStatementReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - var issetStatement bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetStatement = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.MAP { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.I64 { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1283: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1283(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1284: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1284(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1285: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1285(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1286: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1286(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1287: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1287(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1288: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1288(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1289: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1289(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1296: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1296(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - if !issetStatement{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Statement is not set")); - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TExecuteStatementReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Statement = v -} - return nil -} - -func (p *TExecuteStatementReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]string, size) - p.ConfOverlay = tMap - for i := 0; i < size; i ++ { -var _key57 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _key57 = v -} -var _val58 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _val58 = v -} - p.ConfOverlay[_key57] = _val58 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TExecuteStatementReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.RunAsync = v -} - return nil -} - -func (p *TExecuteStatementReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TExecuteStatementReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.QueryTimeout = v -} - return nil -} - -func (p *TExecuteStatementReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.CanReadArrowResult_ = &v -} - return nil -} - -func (p *TExecuteStatementReq) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1283: ", err) -} else { - p.CanDownloadResult_ = &v -} - return nil -} - -func (p *TExecuteStatementReq) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1284: ", err) -} else { - p.CanDecompressLZ4Result_ = &v -} - return nil -} - -func (p *TExecuteStatementReq) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1285: ", err) -} else { - p.MaxBytesPerFile = &v -} - return nil -} - -func (p *TExecuteStatementReq) ReadField1286(ctx context.Context, iprot thrift.TProtocol) error { - p.UseArrowNativeTypes = &TSparkArrowTypes{} - if err := p.UseArrowNativeTypes.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UseArrowNativeTypes), err) - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1287(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1287: ", err) -} else { - p.ResultRowLimit = &v -} - return nil -} - -func (p *TExecuteStatementReq) ReadField1288(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TSparkParameter, 0, size) - p.Parameters = tSlice - for i := 0; i < size; i ++ { - _elem59 := &TSparkParameter{} - if err := _elem59.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err) - } - p.Parameters = append(p.Parameters, _elem59) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1289(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1289: ", err) -} else { - p.MaxBytesPerBatch = &v -} - return nil -} - -func (p *TExecuteStatementReq) ReadField1296(ctx context.Context, iprot thrift.TProtocol) error { - p.StatementConf = &TStatementConf{} - if err := p.StatementConf.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StatementConf), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + var issetStatement bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetStatement = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1283: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1283(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1284: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1284(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1285: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1285(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1286: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1286(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1287: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1287(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1288: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1288(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1289: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1289(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1296: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1296(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + if !issetStatement { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Statement is not set")) + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TExecuteStatementReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Statement = v + } + return nil +} + +func (p *TExecuteStatementReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.ConfOverlay = tMap + for i := 0; i < size; i++ { + var _key57 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key57 = v + } + var _val58 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val58 = v + } + p.ConfOverlay[_key57] = _val58 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *TExecuteStatementReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.RunAsync = v + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TExecuteStatementReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.QueryTimeout = v + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.CanReadArrowResult_ = &v + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1283: ", err) + } else { + p.CanDownloadResult_ = &v + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1284: ", err) + } else { + p.CanDecompressLZ4Result_ = &v + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1285: ", err) + } else { + p.MaxBytesPerFile = &v + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1286(ctx context.Context, iprot thrift.TProtocol) error { + p.UseArrowNativeTypes = &TSparkArrowTypes{} + if err := p.UseArrowNativeTypes.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UseArrowNativeTypes), err) + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1287(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1287: ", err) + } else { + p.ResultRowLimit = &v + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1288(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TSparkParameter, 0, size) + p.Parameters = tSlice + for i := 0; i < size; i++ { + _elem59 := &TSparkParameter{} + if err := _elem59.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err) + } + p.Parameters = append(p.Parameters, _elem59) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1289(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1289: ", err) + } else { + p.MaxBytesPerBatch = &v + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1296(ctx context.Context, iprot thrift.TProtocol) error { + p.StatementConf = &TStatementConf{} + if err := p.StatementConf.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StatementConf), err) + } + return nil } func (p *TExecuteStatementReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TExecuteStatementReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - if err := p.writeField1283(ctx, oprot); err != nil { return err } - if err := p.writeField1284(ctx, oprot); err != nil { return err } - if err := p.writeField1285(ctx, oprot); err != nil { return err } - if err := p.writeField1286(ctx, oprot); err != nil { return err } - if err := p.writeField1287(ctx, oprot); err != nil { return err } - if err := p.writeField1288(ctx, oprot); err != nil { return err } - if err := p.writeField1289(ctx, oprot); err != nil { return err } - if err := p.writeField1296(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TExecuteStatementReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + if err := p.writeField1283(ctx, oprot); err != nil { + return err + } + if err := p.writeField1284(ctx, oprot); err != nil { + return err + } + if err := p.writeField1285(ctx, oprot); err != nil { + return err + } + if err := p.writeField1286(ctx, oprot); err != nil { + return err + } + if err := p.writeField1287(ctx, oprot); err != nil { + return err + } + if err := p.writeField1288(ctx, oprot); err != nil { + return err + } + if err := p.writeField1289(ctx, oprot); err != nil { + return err + } + if err := p.writeField1296(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TExecuteStatementReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TExecuteStatementReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "statement", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statement: ", p), err) } - if err := oprot.WriteString(ctx, string(p.Statement)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.statement (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statement: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "statement", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statement: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.Statement)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.statement (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statement: ", p), err) + } + return err } func (p *TExecuteStatementReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetConfOverlay() { - if err := oprot.WriteFieldBegin(ctx, "confOverlay", thrift.MAP, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:confOverlay: ", p), err) } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.ConfOverlay)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.ConfOverlay { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:confOverlay: ", p), err) } - } - return err + if p.IsSetConfOverlay() { + if err := oprot.WriteFieldBegin(ctx, "confOverlay", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:confOverlay: ", p), err) + } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.ConfOverlay)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.ConfOverlay { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:confOverlay: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:runAsync: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:runAsync: ", p), err) } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:runAsync: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:runAsync: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetQueryTimeout() { - if err := oprot.WriteFieldBegin(ctx, "queryTimeout", thrift.I64, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:queryTimeout: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.QueryTimeout)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.queryTimeout (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:queryTimeout: ", p), err) } - } - return err + if p.IsSetQueryTimeout() { + if err := oprot.WriteFieldBegin(ctx, "queryTimeout", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:queryTimeout: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.QueryTimeout)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.queryTimeout (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:queryTimeout: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) + } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCanReadArrowResult_() { - if err := oprot.WriteFieldBegin(ctx, "canReadArrowResult", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:canReadArrowResult: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.CanReadArrowResult_)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.canReadArrowResult (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:canReadArrowResult: ", p), err) } - } - return err + if p.IsSetCanReadArrowResult_() { + if err := oprot.WriteFieldBegin(ctx, "canReadArrowResult", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:canReadArrowResult: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.CanReadArrowResult_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.canReadArrowResult (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:canReadArrowResult: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) writeField1283(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCanDownloadResult_() { - if err := oprot.WriteFieldBegin(ctx, "canDownloadResult", thrift.BOOL, 1283); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:canDownloadResult: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.CanDownloadResult_)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.canDownloadResult (1283) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:canDownloadResult: ", p), err) } - } - return err + if p.IsSetCanDownloadResult_() { + if err := oprot.WriteFieldBegin(ctx, "canDownloadResult", thrift.BOOL, 1283); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:canDownloadResult: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.CanDownloadResult_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.canDownloadResult (1283) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:canDownloadResult: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) writeField1284(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCanDecompressLZ4Result_() { - if err := oprot.WriteFieldBegin(ctx, "canDecompressLZ4Result", thrift.BOOL, 1284); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:canDecompressLZ4Result: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.CanDecompressLZ4Result_)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.canDecompressLZ4Result (1284) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:canDecompressLZ4Result: ", p), err) } - } - return err + if p.IsSetCanDecompressLZ4Result_() { + if err := oprot.WriteFieldBegin(ctx, "canDecompressLZ4Result", thrift.BOOL, 1284); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:canDecompressLZ4Result: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.CanDecompressLZ4Result_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.canDecompressLZ4Result (1284) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:canDecompressLZ4Result: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) writeField1285(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetMaxBytesPerFile() { - if err := oprot.WriteFieldBegin(ctx, "maxBytesPerFile", thrift.I64, 1285); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:maxBytesPerFile: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.MaxBytesPerFile)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxBytesPerFile (1285) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:maxBytesPerFile: ", p), err) } - } - return err + if p.IsSetMaxBytesPerFile() { + if err := oprot.WriteFieldBegin(ctx, "maxBytesPerFile", thrift.I64, 1285); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:maxBytesPerFile: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.MaxBytesPerFile)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxBytesPerFile (1285) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:maxBytesPerFile: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) writeField1286(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetUseArrowNativeTypes() { - if err := oprot.WriteFieldBegin(ctx, "useArrowNativeTypes", thrift.STRUCT, 1286); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1286:useArrowNativeTypes: ", p), err) } - if err := p.UseArrowNativeTypes.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UseArrowNativeTypes), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1286:useArrowNativeTypes: ", p), err) } - } - return err + if p.IsSetUseArrowNativeTypes() { + if err := oprot.WriteFieldBegin(ctx, "useArrowNativeTypes", thrift.STRUCT, 1286); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1286:useArrowNativeTypes: ", p), err) + } + if err := p.UseArrowNativeTypes.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UseArrowNativeTypes), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1286:useArrowNativeTypes: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) writeField1287(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResultRowLimit() { - if err := oprot.WriteFieldBegin(ctx, "resultRowLimit", thrift.I64, 1287); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1287:resultRowLimit: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.ResultRowLimit)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.resultRowLimit (1287) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1287:resultRowLimit: ", p), err) } - } - return err + if p.IsSetResultRowLimit() { + if err := oprot.WriteFieldBegin(ctx, "resultRowLimit", thrift.I64, 1287); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1287:resultRowLimit: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.ResultRowLimit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.resultRowLimit (1287) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1287:resultRowLimit: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) writeField1288(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetParameters() { - if err := oprot.WriteFieldBegin(ctx, "parameters", thrift.LIST, 1288); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1288:parameters: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Parameters)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Parameters { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1288:parameters: ", p), err) } - } - return err + if p.IsSetParameters() { + if err := oprot.WriteFieldBegin(ctx, "parameters", thrift.LIST, 1288); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1288:parameters: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Parameters)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parameters { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1288:parameters: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) writeField1289(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetMaxBytesPerBatch() { - if err := oprot.WriteFieldBegin(ctx, "maxBytesPerBatch", thrift.I64, 1289); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1289:maxBytesPerBatch: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.MaxBytesPerBatch)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxBytesPerBatch (1289) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1289:maxBytesPerBatch: ", p), err) } - } - return err + if p.IsSetMaxBytesPerBatch() { + if err := oprot.WriteFieldBegin(ctx, "maxBytesPerBatch", thrift.I64, 1289); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1289:maxBytesPerBatch: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.MaxBytesPerBatch)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxBytesPerBatch (1289) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1289:maxBytesPerBatch: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) writeField1296(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStatementConf() { - if err := oprot.WriteFieldBegin(ctx, "statementConf", thrift.STRUCT, 1296); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1296:statementConf: ", p), err) } - if err := p.StatementConf.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StatementConf), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1296:statementConf: ", p), err) } - } - return err + if p.IsSetStatementConf() { + if err := oprot.WriteFieldBegin(ctx, "statementConf", thrift.STRUCT, 1296); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1296:statementConf: ", p), err) + } + if err := p.StatementConf.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StatementConf), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1296:statementConf: ", p), err) + } + } + return err } func (p *TExecuteStatementReq) Equals(other *TExecuteStatementReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.Statement != other.Statement { return false } - if len(p.ConfOverlay) != len(other.ConfOverlay) { return false } - for k, _tgt := range p.ConfOverlay { - _src60 := other.ConfOverlay[k] - if _tgt != _src60 { return false } - } - if p.RunAsync != other.RunAsync { return false } - if p.QueryTimeout != other.QueryTimeout { return false } - if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } - if p.CanReadArrowResult_ != other.CanReadArrowResult_ { - if p.CanReadArrowResult_ == nil || other.CanReadArrowResult_ == nil { - return false - } - if (*p.CanReadArrowResult_) != (*other.CanReadArrowResult_) { return false } - } - if p.CanDownloadResult_ != other.CanDownloadResult_ { - if p.CanDownloadResult_ == nil || other.CanDownloadResult_ == nil { - return false - } - if (*p.CanDownloadResult_) != (*other.CanDownloadResult_) { return false } - } - if p.CanDecompressLZ4Result_ != other.CanDecompressLZ4Result_ { - if p.CanDecompressLZ4Result_ == nil || other.CanDecompressLZ4Result_ == nil { - return false - } - if (*p.CanDecompressLZ4Result_) != (*other.CanDecompressLZ4Result_) { return false } - } - if p.MaxBytesPerFile != other.MaxBytesPerFile { - if p.MaxBytesPerFile == nil || other.MaxBytesPerFile == nil { - return false - } - if (*p.MaxBytesPerFile) != (*other.MaxBytesPerFile) { return false } - } - if !p.UseArrowNativeTypes.Equals(other.UseArrowNativeTypes) { return false } - if p.ResultRowLimit != other.ResultRowLimit { - if p.ResultRowLimit == nil || other.ResultRowLimit == nil { - return false - } - if (*p.ResultRowLimit) != (*other.ResultRowLimit) { return false } - } - if len(p.Parameters) != len(other.Parameters) { return false } - for i, _tgt := range p.Parameters { - _src61 := other.Parameters[i] - if !_tgt.Equals(_src61) { return false } - } - if p.MaxBytesPerBatch != other.MaxBytesPerBatch { - if p.MaxBytesPerBatch == nil || other.MaxBytesPerBatch == nil { - return false - } - if (*p.MaxBytesPerBatch) != (*other.MaxBytesPerBatch) { return false } - } - if !p.StatementConf.Equals(other.StatementConf) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if p.Statement != other.Statement { + return false + } + if len(p.ConfOverlay) != len(other.ConfOverlay) { + return false + } + for k, _tgt := range p.ConfOverlay { + _src60 := other.ConfOverlay[k] + if _tgt != _src60 { + return false + } + } + if p.RunAsync != other.RunAsync { + return false + } + if p.QueryTimeout != other.QueryTimeout { + return false + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { + return false + } + if p.CanReadArrowResult_ != other.CanReadArrowResult_ { + if p.CanReadArrowResult_ == nil || other.CanReadArrowResult_ == nil { + return false + } + if (*p.CanReadArrowResult_) != (*other.CanReadArrowResult_) { + return false + } + } + if p.CanDownloadResult_ != other.CanDownloadResult_ { + if p.CanDownloadResult_ == nil || other.CanDownloadResult_ == nil { + return false + } + if (*p.CanDownloadResult_) != (*other.CanDownloadResult_) { + return false + } + } + if p.CanDecompressLZ4Result_ != other.CanDecompressLZ4Result_ { + if p.CanDecompressLZ4Result_ == nil || other.CanDecompressLZ4Result_ == nil { + return false + } + if (*p.CanDecompressLZ4Result_) != (*other.CanDecompressLZ4Result_) { + return false + } + } + if p.MaxBytesPerFile != other.MaxBytesPerFile { + if p.MaxBytesPerFile == nil || other.MaxBytesPerFile == nil { + return false + } + if (*p.MaxBytesPerFile) != (*other.MaxBytesPerFile) { + return false + } + } + if !p.UseArrowNativeTypes.Equals(other.UseArrowNativeTypes) { + return false + } + if p.ResultRowLimit != other.ResultRowLimit { + if p.ResultRowLimit == nil || other.ResultRowLimit == nil { + return false + } + if (*p.ResultRowLimit) != (*other.ResultRowLimit) { + return false + } + } + if len(p.Parameters) != len(other.Parameters) { + return false + } + for i, _tgt := range p.Parameters { + _src61 := other.Parameters[i] + if !_tgt.Equals(_src61) { + return false + } + } + if p.MaxBytesPerBatch != other.MaxBytesPerBatch { + if p.MaxBytesPerBatch == nil || other.MaxBytesPerBatch == nil { + return false + } + if (*p.MaxBytesPerBatch) != (*other.MaxBytesPerBatch) { + return false + } + } + if !p.StatementConf.Equals(other.StatementConf) { + return false + } + return true } func (p *TExecuteStatementReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TExecuteStatementReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TExecuteStatementReq(%+v)", *p) } func (p *TExecuteStatementReq) Validate() error { - return nil + return nil } + // Attributes: -// - StringValue -// - DoubleValue -// - BooleanValue +// - StringValue +// - DoubleValue +// - BooleanValue type TSparkParameterValue struct { - StringValue *string `thrift:"stringValue,1" db:"stringValue" json:"stringValue,omitempty"` - DoubleValue *float64 `thrift:"doubleValue,2" db:"doubleValue" json:"doubleValue,omitempty"` - BooleanValue *bool `thrift:"booleanValue,3" db:"booleanValue" json:"booleanValue,omitempty"` + StringValue *string `thrift:"stringValue,1" db:"stringValue" json:"stringValue,omitempty"` + DoubleValue *float64 `thrift:"doubleValue,2" db:"doubleValue" json:"doubleValue,omitempty"` + BooleanValue *bool `thrift:"booleanValue,3" db:"booleanValue" json:"booleanValue,omitempty"` } func NewTSparkParameterValue() *TSparkParameterValue { - return &TSparkParameterValue{} + return &TSparkParameterValue{} } var TSparkParameterValue_StringValue_DEFAULT string + func (p *TSparkParameterValue) GetStringValue() string { - if !p.IsSetStringValue() { - return TSparkParameterValue_StringValue_DEFAULT - } -return *p.StringValue + if !p.IsSetStringValue() { + return TSparkParameterValue_StringValue_DEFAULT + } + return *p.StringValue } + var TSparkParameterValue_DoubleValue_DEFAULT float64 + func (p *TSparkParameterValue) GetDoubleValue() float64 { - if !p.IsSetDoubleValue() { - return TSparkParameterValue_DoubleValue_DEFAULT - } -return *p.DoubleValue + if !p.IsSetDoubleValue() { + return TSparkParameterValue_DoubleValue_DEFAULT + } + return *p.DoubleValue } + var TSparkParameterValue_BooleanValue_DEFAULT bool + func (p *TSparkParameterValue) GetBooleanValue() bool { - if !p.IsSetBooleanValue() { - return TSparkParameterValue_BooleanValue_DEFAULT - } -return *p.BooleanValue + if !p.IsSetBooleanValue() { + return TSparkParameterValue_BooleanValue_DEFAULT + } + return *p.BooleanValue } func (p *TSparkParameterValue) CountSetFieldsTSparkParameterValue() int { - count := 0 - if (p.IsSetStringValue()) { - count++ - } - if (p.IsSetDoubleValue()) { - count++ - } - if (p.IsSetBooleanValue()) { - count++ - } - return count + count := 0 + if p.IsSetStringValue() { + count++ + } + if p.IsSetDoubleValue() { + count++ + } + if p.IsSetBooleanValue() { + count++ + } + return count } func (p *TSparkParameterValue) IsSetStringValue() bool { - return p.StringValue != nil + return p.StringValue != nil } func (p *TSparkParameterValue) IsSetDoubleValue() bool { - return p.DoubleValue != nil + return p.DoubleValue != nil } func (p *TSparkParameterValue) IsSetBooleanValue() bool { - return p.BooleanValue != nil + return p.BooleanValue != nil } func (p *TSparkParameterValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TSparkParameterValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.StringValue = &v -} - return nil -} - -func (p *TSparkParameterValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.DoubleValue = &v -} - return nil -} - -func (p *TSparkParameterValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.BooleanValue = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TSparkParameterValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.StringValue = &v + } + return nil +} + +func (p *TSparkParameterValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.DoubleValue = &v + } + return nil +} + +func (p *TSparkParameterValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.BooleanValue = &v + } + return nil } func (p *TSparkParameterValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTSparkParameterValue(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TSparkParameterValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if c := p.CountSetFieldsTSparkParameterValue(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TSparkParameterValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TSparkParameterValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringValue() { - if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:stringValue: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.stringValue (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:stringValue: ", p), err) } - } - return err + if p.IsSetStringValue() { + if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:stringValue: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stringValue (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:stringValue: ", p), err) + } + } + return err } func (p *TSparkParameterValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDoubleValue() { - if err := oprot.WriteFieldBegin(ctx, "doubleValue", thrift.DOUBLE, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:doubleValue: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(*p.DoubleValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.doubleValue (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:doubleValue: ", p), err) } - } - return err + if p.IsSetDoubleValue() { + if err := oprot.WriteFieldBegin(ctx, "doubleValue", thrift.DOUBLE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:doubleValue: ", p), err) + } + if err := oprot.WriteDouble(ctx, float64(*p.DoubleValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.doubleValue (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:doubleValue: ", p), err) + } + } + return err } func (p *TSparkParameterValue) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBooleanValue() { - if err := oprot.WriteFieldBegin(ctx, "booleanValue", thrift.BOOL, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:booleanValue: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.BooleanValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.booleanValue (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:booleanValue: ", p), err) } - } - return err + if p.IsSetBooleanValue() { + if err := oprot.WriteFieldBegin(ctx, "booleanValue", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:booleanValue: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.BooleanValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.booleanValue (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:booleanValue: ", p), err) + } + } + return err } func (p *TSparkParameterValue) Equals(other *TSparkParameterValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.StringValue != other.StringValue { - if p.StringValue == nil || other.StringValue == nil { - return false - } - if (*p.StringValue) != (*other.StringValue) { return false } - } - if p.DoubleValue != other.DoubleValue { - if p.DoubleValue == nil || other.DoubleValue == nil { - return false - } - if (*p.DoubleValue) != (*other.DoubleValue) { return false } - } - if p.BooleanValue != other.BooleanValue { - if p.BooleanValue == nil || other.BooleanValue == nil { - return false - } - if (*p.BooleanValue) != (*other.BooleanValue) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StringValue != other.StringValue { + if p.StringValue == nil || other.StringValue == nil { + return false + } + if (*p.StringValue) != (*other.StringValue) { + return false + } + } + if p.DoubleValue != other.DoubleValue { + if p.DoubleValue == nil || other.DoubleValue == nil { + return false + } + if (*p.DoubleValue) != (*other.DoubleValue) { + return false + } + } + if p.BooleanValue != other.BooleanValue { + if p.BooleanValue == nil || other.BooleanValue == nil { + return false + } + if (*p.BooleanValue) != (*other.BooleanValue) { + return false + } + } + return true } func (p *TSparkParameterValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkParameterValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkParameterValue(%+v)", *p) } func (p *TSparkParameterValue) Validate() error { - return nil + return nil } + // Attributes: -// - Type -// - Value -// - Arguments +// - Type +// - Value +// - Arguments type TSparkParameterValueArg struct { - Type *string `thrift:"type,1" db:"type" json:"type,omitempty"` - Value *string `thrift:"value,2" db:"value" json:"value,omitempty"` - Arguments []*TSparkParameterValueArg `thrift:"arguments,3" db:"arguments" json:"arguments,omitempty"` + Type *string `thrift:"type,1" db:"type" json:"type,omitempty"` + Value *string `thrift:"value,2" db:"value" json:"value,omitempty"` + Arguments []*TSparkParameterValueArg `thrift:"arguments,3" db:"arguments" json:"arguments,omitempty"` } func NewTSparkParameterValueArg() *TSparkParameterValueArg { - return &TSparkParameterValueArg{} + return &TSparkParameterValueArg{} } var TSparkParameterValueArg_Type_DEFAULT string + func (p *TSparkParameterValueArg) GetType() string { - if !p.IsSetType() { - return TSparkParameterValueArg_Type_DEFAULT - } -return *p.Type + if !p.IsSetType() { + return TSparkParameterValueArg_Type_DEFAULT + } + return *p.Type } + var TSparkParameterValueArg_Value_DEFAULT string + func (p *TSparkParameterValueArg) GetValue() string { - if !p.IsSetValue() { - return TSparkParameterValueArg_Value_DEFAULT - } -return *p.Value + if !p.IsSetValue() { + return TSparkParameterValueArg_Value_DEFAULT + } + return *p.Value } + var TSparkParameterValueArg_Arguments_DEFAULT []*TSparkParameterValueArg func (p *TSparkParameterValueArg) GetArguments() []*TSparkParameterValueArg { - return p.Arguments + return p.Arguments } func (p *TSparkParameterValueArg) IsSetType() bool { - return p.Type != nil + return p.Type != nil } func (p *TSparkParameterValueArg) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TSparkParameterValueArg) IsSetArguments() bool { - return p.Arguments != nil + return p.Arguments != nil } func (p *TSparkParameterValueArg) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.LIST { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TSparkParameterValueArg) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Type = &v -} - return nil -} - -func (p *TSparkParameterValueArg) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Value = &v -} - return nil -} - -func (p *TSparkParameterValueArg) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TSparkParameterValueArg, 0, size) - p.Arguments = tSlice - for i := 0; i < size; i ++ { - _elem62 := &TSparkParameterValueArg{} - if err := _elem62.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) - } - p.Arguments = append(p.Arguments, _elem62) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TSparkParameterValueArg) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Type = &v + } + return nil +} + +func (p *TSparkParameterValueArg) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Value = &v + } + return nil +} + +func (p *TSparkParameterValueArg) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TSparkParameterValueArg, 0, size) + p.Arguments = tSlice + for i := 0; i < size; i++ { + _elem62 := &TSparkParameterValueArg{} + if err := _elem62.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) + } + p.Arguments = append(p.Arguments, _elem62) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TSparkParameterValueArg) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkParameterValueArg"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkParameterValueArg"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TSparkParameterValueArg) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetType() { - if err := oprot.WriteFieldBegin(ctx, "type", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.Type)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } - } - return err + if p.IsSetType() { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) + } + } + return err } func (p *TSparkParameterValueArg) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) + } + } + return err } func (p *TSparkParameterValueArg) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArguments() { - if err := oprot.WriteFieldBegin(ctx, "arguments", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:arguments: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Arguments)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Arguments { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:arguments: ", p), err) } - } - return err + if p.IsSetArguments() { + if err := oprot.WriteFieldBegin(ctx, "arguments", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:arguments: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Arguments)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Arguments { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:arguments: ", p), err) + } + } + return err } func (p *TSparkParameterValueArg) Equals(other *TSparkParameterValueArg) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Type != other.Type { - if p.Type == nil || other.Type == nil { - return false - } - if (*p.Type) != (*other.Type) { return false } - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { return false } - } - if len(p.Arguments) != len(other.Arguments) { return false } - for i, _tgt := range p.Arguments { - _src63 := other.Arguments[i] - if !_tgt.Equals(_src63) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Type != other.Type { + if p.Type == nil || other.Type == nil { + return false + } + if (*p.Type) != (*other.Type) { + return false + } + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { + return false + } + } + if len(p.Arguments) != len(other.Arguments) { + return false + } + for i, _tgt := range p.Arguments { + _src63 := other.Arguments[i] + if !_tgt.Equals(_src63) { + return false + } + } + return true } func (p *TSparkParameterValueArg) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkParameterValueArg(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkParameterValueArg(%+v)", *p) } func (p *TSparkParameterValueArg) Validate() error { - return nil + return nil } + // Attributes: -// - Ordinal -// - Name -// - Type -// - Value -// - Arguments +// - Ordinal +// - Name +// - Type +// - Value +// - Arguments type TSparkParameter struct { - Ordinal *int32 `thrift:"ordinal,1" db:"ordinal" json:"ordinal,omitempty"` - Name *string `thrift:"name,2" db:"name" json:"name,omitempty"` - Type *string `thrift:"type,3" db:"type" json:"type,omitempty"` - Value *TSparkParameterValue `thrift:"value,4" db:"value" json:"value,omitempty"` - Arguments []*TSparkParameterValueArg `thrift:"arguments,5" db:"arguments" json:"arguments,omitempty"` + Ordinal *int32 `thrift:"ordinal,1" db:"ordinal" json:"ordinal,omitempty"` + Name *string `thrift:"name,2" db:"name" json:"name,omitempty"` + Type *string `thrift:"type,3" db:"type" json:"type,omitempty"` + Value *TSparkParameterValue `thrift:"value,4" db:"value" json:"value,omitempty"` + Arguments []*TSparkParameterValueArg `thrift:"arguments,5" db:"arguments" json:"arguments,omitempty"` } func NewTSparkParameter() *TSparkParameter { - return &TSparkParameter{} + return &TSparkParameter{} } var TSparkParameter_Ordinal_DEFAULT int32 + func (p *TSparkParameter) GetOrdinal() int32 { - if !p.IsSetOrdinal() { - return TSparkParameter_Ordinal_DEFAULT - } -return *p.Ordinal + if !p.IsSetOrdinal() { + return TSparkParameter_Ordinal_DEFAULT + } + return *p.Ordinal } + var TSparkParameter_Name_DEFAULT string + func (p *TSparkParameter) GetName() string { - if !p.IsSetName() { - return TSparkParameter_Name_DEFAULT - } -return *p.Name + if !p.IsSetName() { + return TSparkParameter_Name_DEFAULT + } + return *p.Name } + var TSparkParameter_Type_DEFAULT string + func (p *TSparkParameter) GetType() string { - if !p.IsSetType() { - return TSparkParameter_Type_DEFAULT - } -return *p.Type + if !p.IsSetType() { + return TSparkParameter_Type_DEFAULT + } + return *p.Type } + var TSparkParameter_Value_DEFAULT *TSparkParameterValue + func (p *TSparkParameter) GetValue() *TSparkParameterValue { - if !p.IsSetValue() { - return TSparkParameter_Value_DEFAULT - } -return p.Value + if !p.IsSetValue() { + return TSparkParameter_Value_DEFAULT + } + return p.Value } + var TSparkParameter_Arguments_DEFAULT []*TSparkParameterValueArg func (p *TSparkParameter) GetArguments() []*TSparkParameterValueArg { - return p.Arguments + return p.Arguments } func (p *TSparkParameter) IsSetOrdinal() bool { - return p.Ordinal != nil + return p.Ordinal != nil } func (p *TSparkParameter) IsSetName() bool { - return p.Name != nil + return p.Name != nil } func (p *TSparkParameter) IsSetType() bool { - return p.Type != nil + return p.Type != nil } func (p *TSparkParameter) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TSparkParameter) IsSetArguments() bool { - return p.Arguments != nil + return p.Arguments != nil } func (p *TSparkParameter) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.LIST { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TSparkParameter) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Ordinal = &v -} - return nil -} - -func (p *TSparkParameter) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Name = &v -} - return nil -} - -func (p *TSparkParameter) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.Type = &v -} - return nil -} - -func (p *TSparkParameter) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.Value = &TSparkParameterValue{} - if err := p.Value.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) - } - return nil -} - -func (p *TSparkParameter) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TSparkParameterValueArg, 0, size) - p.Arguments = tSlice - for i := 0; i < size; i ++ { - _elem64 := &TSparkParameterValueArg{} - if err := _elem64.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem64), err) - } - p.Arguments = append(p.Arguments, _elem64) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.LIST { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TSparkParameter) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Ordinal = &v + } + return nil +} + +func (p *TSparkParameter) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Name = &v + } + return nil +} + +func (p *TSparkParameter) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Type = &v + } + return nil +} + +func (p *TSparkParameter) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.Value = &TSparkParameterValue{} + if err := p.Value.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) + } + return nil +} + +func (p *TSparkParameter) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TSparkParameterValueArg, 0, size) + p.Arguments = tSlice + for i := 0; i < size; i++ { + _elem64 := &TSparkParameterValueArg{} + if err := _elem64.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem64), err) + } + p.Arguments = append(p.Arguments, _elem64) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TSparkParameter) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkParameter"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkParameter"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TSparkParameter) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOrdinal() { - if err := oprot.WriteFieldBegin(ctx, "ordinal", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ordinal: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.Ordinal)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.ordinal (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ordinal: ", p), err) } - } - return err + if p.IsSetOrdinal() { + if err := oprot.WriteFieldBegin(ctx, "ordinal", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ordinal: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.Ordinal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ordinal (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ordinal: ", p), err) + } + } + return err } func (p *TSparkParameter) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetName() { - if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.Name)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } - } - return err + if p.IsSetName() { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.Name)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) + } + } + return err } func (p *TSparkParameter) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetType() { - if err := oprot.WriteFieldBegin(ctx, "type", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.Type)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.type (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type: ", p), err) } - } - return err + if p.IsSetType() { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type: ", p), err) + } + } + return err } func (p *TSparkParameter) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:value: ", p), err) } - if err := p.Value.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:value: ", p), err) } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:value: ", p), err) + } + if err := p.Value.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:value: ", p), err) + } + } + return err } func (p *TSparkParameter) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArguments() { - if err := oprot.WriteFieldBegin(ctx, "arguments", thrift.LIST, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:arguments: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Arguments)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Arguments { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:arguments: ", p), err) } - } - return err + if p.IsSetArguments() { + if err := oprot.WriteFieldBegin(ctx, "arguments", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:arguments: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Arguments)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Arguments { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:arguments: ", p), err) + } + } + return err } func (p *TSparkParameter) Equals(other *TSparkParameter) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Ordinal != other.Ordinal { - if p.Ordinal == nil || other.Ordinal == nil { - return false - } - if (*p.Ordinal) != (*other.Ordinal) { return false } - } - if p.Name != other.Name { - if p.Name == nil || other.Name == nil { - return false - } - if (*p.Name) != (*other.Name) { return false } - } - if p.Type != other.Type { - if p.Type == nil || other.Type == nil { - return false - } - if (*p.Type) != (*other.Type) { return false } - } - if !p.Value.Equals(other.Value) { return false } - if len(p.Arguments) != len(other.Arguments) { return false } - for i, _tgt := range p.Arguments { - _src65 := other.Arguments[i] - if !_tgt.Equals(_src65) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Ordinal != other.Ordinal { + if p.Ordinal == nil || other.Ordinal == nil { + return false + } + if (*p.Ordinal) != (*other.Ordinal) { + return false + } + } + if p.Name != other.Name { + if p.Name == nil || other.Name == nil { + return false + } + if (*p.Name) != (*other.Name) { + return false + } + } + if p.Type != other.Type { + if p.Type == nil || other.Type == nil { + return false + } + if (*p.Type) != (*other.Type) { + return false + } + } + if !p.Value.Equals(other.Value) { + return false + } + if len(p.Arguments) != len(other.Arguments) { + return false + } + for i, _tgt := range p.Arguments { + _src65 := other.Arguments[i] + if !_tgt.Equals(_src65) { + return false + } + } + return true } func (p *TSparkParameter) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkParameter(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkParameter(%+v)", *p) } func (p *TSparkParameter) Validate() error { - return nil + return nil } + // Attributes: -// - Sessionless -// - InitialNamespace -// - ClientProtocol -// - ClientProtocolI64 +// - Sessionless +// - InitialNamespace +// - ClientProtocol +// - ClientProtocolI64 type TStatementConf struct { - Sessionless *bool `thrift:"sessionless,1" db:"sessionless" json:"sessionless,omitempty"` - InitialNamespace *TNamespace `thrift:"initialNamespace,2" db:"initialNamespace" json:"initialNamespace,omitempty"` - ClientProtocol *TProtocolVersion `thrift:"client_protocol,3" db:"client_protocol" json:"client_protocol,omitempty"` - ClientProtocolI64 *int64 `thrift:"client_protocol_i64,4" db:"client_protocol_i64" json:"client_protocol_i64,omitempty"` + Sessionless *bool `thrift:"sessionless,1" db:"sessionless" json:"sessionless,omitempty"` + InitialNamespace *TNamespace `thrift:"initialNamespace,2" db:"initialNamespace" json:"initialNamespace,omitempty"` + ClientProtocol *TProtocolVersion `thrift:"client_protocol,3" db:"client_protocol" json:"client_protocol,omitempty"` + ClientProtocolI64 *int64 `thrift:"client_protocol_i64,4" db:"client_protocol_i64" json:"client_protocol_i64,omitempty"` } func NewTStatementConf() *TStatementConf { - return &TStatementConf{} + return &TStatementConf{} } var TStatementConf_Sessionless_DEFAULT bool + func (p *TStatementConf) GetSessionless() bool { - if !p.IsSetSessionless() { - return TStatementConf_Sessionless_DEFAULT - } -return *p.Sessionless + if !p.IsSetSessionless() { + return TStatementConf_Sessionless_DEFAULT + } + return *p.Sessionless } + var TStatementConf_InitialNamespace_DEFAULT *TNamespace + func (p *TStatementConf) GetInitialNamespace() *TNamespace { - if !p.IsSetInitialNamespace() { - return TStatementConf_InitialNamespace_DEFAULT - } -return p.InitialNamespace + if !p.IsSetInitialNamespace() { + return TStatementConf_InitialNamespace_DEFAULT + } + return p.InitialNamespace } + var TStatementConf_ClientProtocol_DEFAULT TProtocolVersion + func (p *TStatementConf) GetClientProtocol() TProtocolVersion { - if !p.IsSetClientProtocol() { - return TStatementConf_ClientProtocol_DEFAULT - } -return *p.ClientProtocol + if !p.IsSetClientProtocol() { + return TStatementConf_ClientProtocol_DEFAULT + } + return *p.ClientProtocol } + var TStatementConf_ClientProtocolI64_DEFAULT int64 + func (p *TStatementConf) GetClientProtocolI64() int64 { - if !p.IsSetClientProtocolI64() { - return TStatementConf_ClientProtocolI64_DEFAULT - } -return *p.ClientProtocolI64 + if !p.IsSetClientProtocolI64() { + return TStatementConf_ClientProtocolI64_DEFAULT + } + return *p.ClientProtocolI64 } func (p *TStatementConf) IsSetSessionless() bool { - return p.Sessionless != nil + return p.Sessionless != nil } func (p *TStatementConf) IsSetInitialNamespace() bool { - return p.InitialNamespace != nil + return p.InitialNamespace != nil } func (p *TStatementConf) IsSetClientProtocol() bool { - return p.ClientProtocol != nil + return p.ClientProtocol != nil } func (p *TStatementConf) IsSetClientProtocolI64() bool { - return p.ClientProtocolI64 != nil + return p.ClientProtocolI64 != nil } func (p *TStatementConf) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I32 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I64 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TStatementConf) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) -} else { - p.Sessionless = &v -} - return nil -} - -func (p *TStatementConf) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.InitialNamespace = &TNamespace{} - if err := p.InitialNamespace.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InitialNamespace), err) - } - return nil -} - -func (p *TStatementConf) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := TProtocolVersion(v) - p.ClientProtocol = &temp -} - return nil -} - -func (p *TStatementConf) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.ClientProtocolI64 = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TStatementConf) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Sessionless = &v + } + return nil +} + +func (p *TStatementConf) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.InitialNamespace = &TNamespace{} + if err := p.InitialNamespace.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InitialNamespace), err) + } + return nil +} + +func (p *TStatementConf) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := TProtocolVersion(v) + p.ClientProtocol = &temp + } + return nil +} + +func (p *TStatementConf) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.ClientProtocolI64 = &v + } + return nil } func (p *TStatementConf) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStatementConf"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TStatementConf"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TStatementConf) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSessionless() { - if err := oprot.WriteFieldBegin(ctx, "sessionless", thrift.BOOL, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionless: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.Sessionless)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.sessionless (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionless: ", p), err) } - } - return err + if p.IsSetSessionless() { + if err := oprot.WriteFieldBegin(ctx, "sessionless", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionless: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.Sessionless)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionless (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionless: ", p), err) + } + } + return err } func (p *TStatementConf) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetInitialNamespace() { - if err := oprot.WriteFieldBegin(ctx, "initialNamespace", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:initialNamespace: ", p), err) } - if err := p.InitialNamespace.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InitialNamespace), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:initialNamespace: ", p), err) } - } - return err + if p.IsSetInitialNamespace() { + if err := oprot.WriteFieldBegin(ctx, "initialNamespace", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:initialNamespace: ", p), err) + } + if err := p.InitialNamespace.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InitialNamespace), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:initialNamespace: ", p), err) + } + } + return err } func (p *TStatementConf) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetClientProtocol() { - if err := oprot.WriteFieldBegin(ctx, "client_protocol", thrift.I32, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:client_protocol: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.ClientProtocol)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.client_protocol (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:client_protocol: ", p), err) } - } - return err + if p.IsSetClientProtocol() { + if err := oprot.WriteFieldBegin(ctx, "client_protocol", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:client_protocol: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.ClientProtocol)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_protocol (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:client_protocol: ", p), err) + } + } + return err } func (p *TStatementConf) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetClientProtocolI64() { - if err := oprot.WriteFieldBegin(ctx, "client_protocol_i64", thrift.I64, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:client_protocol_i64: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.ClientProtocolI64)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.client_protocol_i64 (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:client_protocol_i64: ", p), err) } - } - return err + if p.IsSetClientProtocolI64() { + if err := oprot.WriteFieldBegin(ctx, "client_protocol_i64", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:client_protocol_i64: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.ClientProtocolI64)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_protocol_i64 (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:client_protocol_i64: ", p), err) + } + } + return err } func (p *TStatementConf) Equals(other *TStatementConf) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Sessionless != other.Sessionless { - if p.Sessionless == nil || other.Sessionless == nil { - return false - } - if (*p.Sessionless) != (*other.Sessionless) { return false } - } - if !p.InitialNamespace.Equals(other.InitialNamespace) { return false } - if p.ClientProtocol != other.ClientProtocol { - if p.ClientProtocol == nil || other.ClientProtocol == nil { - return false - } - if (*p.ClientProtocol) != (*other.ClientProtocol) { return false } - } - if p.ClientProtocolI64 != other.ClientProtocolI64 { - if p.ClientProtocolI64 == nil || other.ClientProtocolI64 == nil { - return false - } - if (*p.ClientProtocolI64) != (*other.ClientProtocolI64) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Sessionless != other.Sessionless { + if p.Sessionless == nil || other.Sessionless == nil { + return false + } + if (*p.Sessionless) != (*other.Sessionless) { + return false + } + } + if !p.InitialNamespace.Equals(other.InitialNamespace) { + return false + } + if p.ClientProtocol != other.ClientProtocol { + if p.ClientProtocol == nil || other.ClientProtocol == nil { + return false + } + if (*p.ClientProtocol) != (*other.ClientProtocol) { + return false + } + } + if p.ClientProtocolI64 != other.ClientProtocolI64 { + if p.ClientProtocolI64 == nil || other.ClientProtocolI64 == nil { + return false + } + if (*p.ClientProtocolI64) != (*other.ClientProtocolI64) { + return false + } + } + return true } func (p *TStatementConf) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TStatementConf(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TStatementConf(%+v)", *p) } func (p *TStatementConf) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TExecuteStatementResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTExecuteStatementResp() *TExecuteStatementResp { - return &TExecuteStatementResp{} + return &TExecuteStatementResp{} } var TExecuteStatementResp_Status_DEFAULT *TStatus + func (p *TExecuteStatementResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TExecuteStatementResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TExecuteStatementResp_Status_DEFAULT + } + return p.Status } + var TExecuteStatementResp_OperationHandle_DEFAULT *TOperationHandle + func (p *TExecuteStatementResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TExecuteStatementResp_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TExecuteStatementResp_OperationHandle_DEFAULT + } + return p.OperationHandle } + var TExecuteStatementResp_DirectResults_DEFAULT *TSparkDirectResults + func (p *TExecuteStatementResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TExecuteStatementResp_DirectResults_DEFAULT - } -return p.DirectResults + if !p.IsSetDirectResults() { + return TExecuteStatementResp_DirectResults_DEFAULT + } + return p.DirectResults } func (p *TExecuteStatementResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TExecuteStatementResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TExecuteStatementResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TExecuteStatementResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TExecuteStatementResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TExecuteStatementResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TExecuteStatementResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TExecuteStatementResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TExecuteStatementResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TExecuteStatementResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TExecuteStatementResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TExecuteStatementResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TExecuteStatementResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TExecuteStatementResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TExecuteStatementResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) + } + } + return err } func (p *TExecuteStatementResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) + } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) + } + } + return err } func (p *TExecuteStatementResp) Equals(other *TExecuteStatementResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if !p.DirectResults.Equals(other.DirectResults) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + if !p.DirectResults.Equals(other.DirectResults) { + return false + } + return true } func (p *TExecuteStatementResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TExecuteStatementResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TExecuteStatementResp(%+v)", *p) } func (p *TExecuteStatementResp) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - GetDirectResults +// - RunAsync type TGetTypeInfoReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - // unused fields # 2 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + // unused fields # 2 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetTypeInfoReq() *TGetTypeInfoReq { - return &TGetTypeInfoReq{} + return &TGetTypeInfoReq{} } var TGetTypeInfoReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetTypeInfoReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetTypeInfoReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetTypeInfoReq_SessionHandle_DEFAULT + } + return p.SessionHandle } + var TGetTypeInfoReq_GetDirectResults_DEFAULT *TSparkGetDirectResults + func (p *TGetTypeInfoReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetTypeInfoReq_GetDirectResults_DEFAULT - } -return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetTypeInfoReq_GetDirectResults_DEFAULT + } + return p.GetDirectResults } + var TGetTypeInfoReq_RunAsync_DEFAULT bool = false func (p *TGetTypeInfoReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetTypeInfoReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetTypeInfoReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetTypeInfoReq) IsSetRunAsync() bool { - return p.RunAsync != TGetTypeInfoReq_RunAsync_DEFAULT + return p.RunAsync != TGetTypeInfoReq_RunAsync_DEFAULT } func (p *TGetTypeInfoReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - return nil -} - -func (p *TGetTypeInfoReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetTypeInfoReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetTypeInfoReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.RunAsync = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + return nil +} + +func (p *TGetTypeInfoReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetTypeInfoReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetTypeInfoReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.RunAsync = v + } + return nil } func (p *TGetTypeInfoReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTypeInfoReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetTypeInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetTypeInfoReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TGetTypeInfoReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) + } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) + } + } + return err } func (p *TGetTypeInfoReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) + } + } + return err } func (p *TGetTypeInfoReq) Equals(other *TGetTypeInfoReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } - if p.RunAsync != other.RunAsync { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { + return false + } + if p.RunAsync != other.RunAsync { + return false + } + return true } func (p *TGetTypeInfoReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetTypeInfoReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTypeInfoReq(%+v)", *p) } func (p *TGetTypeInfoReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetTypeInfoResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetTypeInfoResp() *TGetTypeInfoResp { - return &TGetTypeInfoResp{} + return &TGetTypeInfoResp{} } var TGetTypeInfoResp_Status_DEFAULT *TStatus + func (p *TGetTypeInfoResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetTypeInfoResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetTypeInfoResp_Status_DEFAULT + } + return p.Status } + var TGetTypeInfoResp_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetTypeInfoResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetTypeInfoResp_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetTypeInfoResp_OperationHandle_DEFAULT + } + return p.OperationHandle } + var TGetTypeInfoResp_DirectResults_DEFAULT *TSparkDirectResults + func (p *TGetTypeInfoResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetTypeInfoResp_DirectResults_DEFAULT - } -return p.DirectResults + if !p.IsSetDirectResults() { + return TGetTypeInfoResp_DirectResults_DEFAULT + } + return p.DirectResults } func (p *TGetTypeInfoResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetTypeInfoResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetTypeInfoResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetTypeInfoResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TGetTypeInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetTypeInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetTypeInfoResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TGetTypeInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetTypeInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetTypeInfoResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetTypeInfoResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTypeInfoResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetTypeInfoResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetTypeInfoResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TGetTypeInfoResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) + } + } + return err } func (p *TGetTypeInfoResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) + } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) + } + } + return err } func (p *TGetTypeInfoResp) Equals(other *TGetTypeInfoResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if !p.DirectResults.Equals(other.DirectResults) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + if !p.DirectResults.Equals(other.DirectResults) { + return false + } + return true } func (p *TGetTypeInfoResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetTypeInfoResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTypeInfoResp(%+v)", *p) } func (p *TGetTypeInfoResp) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - GetDirectResults +// - RunAsync type TGetCatalogsReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - // unused fields # 2 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + // unused fields # 2 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetCatalogsReq() *TGetCatalogsReq { - return &TGetCatalogsReq{} + return &TGetCatalogsReq{} } var TGetCatalogsReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetCatalogsReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetCatalogsReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetCatalogsReq_SessionHandle_DEFAULT + } + return p.SessionHandle } + var TGetCatalogsReq_GetDirectResults_DEFAULT *TSparkGetDirectResults + func (p *TGetCatalogsReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetCatalogsReq_GetDirectResults_DEFAULT - } -return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetCatalogsReq_GetDirectResults_DEFAULT + } + return p.GetDirectResults } + var TGetCatalogsReq_RunAsync_DEFAULT bool = false func (p *TGetCatalogsReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetCatalogsReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetCatalogsReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetCatalogsReq) IsSetRunAsync() bool { - return p.RunAsync != TGetCatalogsReq_RunAsync_DEFAULT + return p.RunAsync != TGetCatalogsReq_RunAsync_DEFAULT } func (p *TGetCatalogsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - return nil -} - -func (p *TGetCatalogsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetCatalogsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetCatalogsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.RunAsync = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + return nil +} + +func (p *TGetCatalogsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetCatalogsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetCatalogsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.RunAsync = v + } + return nil } func (p *TGetCatalogsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetCatalogsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetCatalogsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetCatalogsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TGetCatalogsReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) + } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) + } + } + return err } func (p *TGetCatalogsReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) + } + } + return err } func (p *TGetCatalogsReq) Equals(other *TGetCatalogsReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } - if p.RunAsync != other.RunAsync { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { + return false + } + if p.RunAsync != other.RunAsync { + return false + } + return true } func (p *TGetCatalogsReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetCatalogsReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetCatalogsReq(%+v)", *p) } func (p *TGetCatalogsReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetCatalogsResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetCatalogsResp() *TGetCatalogsResp { - return &TGetCatalogsResp{} + return &TGetCatalogsResp{} } var TGetCatalogsResp_Status_DEFAULT *TStatus + func (p *TGetCatalogsResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetCatalogsResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetCatalogsResp_Status_DEFAULT + } + return p.Status } + var TGetCatalogsResp_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetCatalogsResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetCatalogsResp_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetCatalogsResp_OperationHandle_DEFAULT + } + return p.OperationHandle } + var TGetCatalogsResp_DirectResults_DEFAULT *TSparkDirectResults + func (p *TGetCatalogsResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetCatalogsResp_DirectResults_DEFAULT - } -return p.DirectResults + if !p.IsSetDirectResults() { + return TGetCatalogsResp_DirectResults_DEFAULT + } + return p.DirectResults } func (p *TGetCatalogsResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetCatalogsResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetCatalogsResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetCatalogsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TGetCatalogsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetCatalogsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetCatalogsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TGetCatalogsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetCatalogsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetCatalogsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetCatalogsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetCatalogsResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetCatalogsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetCatalogsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TGetCatalogsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) + } + } + return err } func (p *TGetCatalogsResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) + } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) + } + } + return err } func (p *TGetCatalogsResp) Equals(other *TGetCatalogsResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if !p.DirectResults.Equals(other.DirectResults) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + if !p.DirectResults.Equals(other.DirectResults) { + return false + } + return true } func (p *TGetCatalogsResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetCatalogsResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetCatalogsResp(%+v)", *p) } func (p *TGetCatalogsResp) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - CatalogName -// - SchemaName -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - CatalogName +// - SchemaName +// - GetDirectResults +// - RunAsync type TGetSchemasReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` - SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` - // unused fields # 4 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` + // unused fields # 4 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetSchemasReq() *TGetSchemasReq { - return &TGetSchemasReq{} + return &TGetSchemasReq{} } var TGetSchemasReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetSchemasReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetSchemasReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetSchemasReq_SessionHandle_DEFAULT + } + return p.SessionHandle } + var TGetSchemasReq_CatalogName_DEFAULT TIdentifier + func (p *TGetSchemasReq) GetCatalogName() TIdentifier { - if !p.IsSetCatalogName() { - return TGetSchemasReq_CatalogName_DEFAULT - } -return *p.CatalogName + if !p.IsSetCatalogName() { + return TGetSchemasReq_CatalogName_DEFAULT + } + return *p.CatalogName } + var TGetSchemasReq_SchemaName_DEFAULT TPatternOrIdentifier + func (p *TGetSchemasReq) GetSchemaName() TPatternOrIdentifier { - if !p.IsSetSchemaName() { - return TGetSchemasReq_SchemaName_DEFAULT - } -return *p.SchemaName + if !p.IsSetSchemaName() { + return TGetSchemasReq_SchemaName_DEFAULT + } + return *p.SchemaName } + var TGetSchemasReq_GetDirectResults_DEFAULT *TSparkGetDirectResults + func (p *TGetSchemasReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetSchemasReq_GetDirectResults_DEFAULT - } -return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetSchemasReq_GetDirectResults_DEFAULT + } + return p.GetDirectResults } + var TGetSchemasReq_RunAsync_DEFAULT bool = false func (p *TGetSchemasReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetSchemasReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetSchemasReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetSchemasReq) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TGetSchemasReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetSchemasReq) IsSetRunAsync() bool { - return p.RunAsync != TGetSchemasReq_RunAsync_DEFAULT + return p.RunAsync != TGetSchemasReq_RunAsync_DEFAULT } func (p *TGetSchemasReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - return nil -} - -func (p *TGetSchemasReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetSchemasReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TIdentifier(v) - p.CatalogName = &temp -} - return nil -} - -func (p *TGetSchemasReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.SchemaName = &temp -} - return nil -} - -func (p *TGetSchemasReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetSchemasReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.RunAsync = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + return nil +} + +func (p *TGetSchemasReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetSchemasReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TIdentifier(v) + p.CatalogName = &temp + } + return nil +} + +func (p *TGetSchemasReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := TPatternOrIdentifier(v) + p.SchemaName = &temp + } + return nil +} + +func (p *TGetSchemasReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetSchemasReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.RunAsync = v + } + return nil } func (p *TGetSchemasReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetSchemasReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetSchemasReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetSchemasReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TGetSchemasReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } - } - return err + if p.IsSetCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) + } + } + return err } func (p *TGetSchemasReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } - } - return err + if p.IsSetSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) + } + } + return err } func (p *TGetSchemasReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) + } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) + } + } + return err } func (p *TGetSchemasReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) + } + } + return err } func (p *TGetSchemasReq) Equals(other *TGetSchemasReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { return false } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { return false } - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } - if p.RunAsync != other.RunAsync { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { + return false + } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { + return false + } + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { + return false + } + if p.RunAsync != other.RunAsync { + return false + } + return true } func (p *TGetSchemasReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetSchemasReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetSchemasReq(%+v)", *p) } func (p *TGetSchemasReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetSchemasResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetSchemasResp() *TGetSchemasResp { - return &TGetSchemasResp{} + return &TGetSchemasResp{} } var TGetSchemasResp_Status_DEFAULT *TStatus + func (p *TGetSchemasResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetSchemasResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetSchemasResp_Status_DEFAULT + } + return p.Status } + var TGetSchemasResp_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetSchemasResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetSchemasResp_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetSchemasResp_OperationHandle_DEFAULT + } + return p.OperationHandle } + var TGetSchemasResp_DirectResults_DEFAULT *TSparkDirectResults + func (p *TGetSchemasResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetSchemasResp_DirectResults_DEFAULT - } -return p.DirectResults + if !p.IsSetDirectResults() { + return TGetSchemasResp_DirectResults_DEFAULT + } + return p.DirectResults } func (p *TGetSchemasResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetSchemasResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetSchemasResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetSchemasResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TGetSchemasResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetSchemasResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetSchemasResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TGetSchemasResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetSchemasResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetSchemasResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetSchemasResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetSchemasResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetSchemasResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetSchemasResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TGetSchemasResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) + } + } + return err } func (p *TGetSchemasResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) + } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) + } + } + return err } func (p *TGetSchemasResp) Equals(other *TGetSchemasResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if !p.DirectResults.Equals(other.DirectResults) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + if !p.DirectResults.Equals(other.DirectResults) { + return false + } + return true } func (p *TGetSchemasResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetSchemasResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetSchemasResp(%+v)", *p) } func (p *TGetSchemasResp) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - CatalogName -// - SchemaName -// - TableName -// - TableTypes -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - CatalogName +// - SchemaName +// - TableName +// - TableTypes +// - GetDirectResults +// - RunAsync type TGetTablesReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - CatalogName *TPatternOrIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` - SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` - TableName *TPatternOrIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` - TableTypes []string `thrift:"tableTypes,5" db:"tableTypes" json:"tableTypes,omitempty"` - // unused fields # 6 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + CatalogName *TPatternOrIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` + TableName *TPatternOrIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` + TableTypes []string `thrift:"tableTypes,5" db:"tableTypes" json:"tableTypes,omitempty"` + // unused fields # 6 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetTablesReq() *TGetTablesReq { - return &TGetTablesReq{} + return &TGetTablesReq{} } var TGetTablesReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetTablesReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetTablesReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetTablesReq_SessionHandle_DEFAULT + } + return p.SessionHandle } + var TGetTablesReq_CatalogName_DEFAULT TPatternOrIdentifier + func (p *TGetTablesReq) GetCatalogName() TPatternOrIdentifier { - if !p.IsSetCatalogName() { - return TGetTablesReq_CatalogName_DEFAULT - } -return *p.CatalogName + if !p.IsSetCatalogName() { + return TGetTablesReq_CatalogName_DEFAULT + } + return *p.CatalogName } + var TGetTablesReq_SchemaName_DEFAULT TPatternOrIdentifier + func (p *TGetTablesReq) GetSchemaName() TPatternOrIdentifier { - if !p.IsSetSchemaName() { - return TGetTablesReq_SchemaName_DEFAULT - } -return *p.SchemaName + if !p.IsSetSchemaName() { + return TGetTablesReq_SchemaName_DEFAULT + } + return *p.SchemaName } + var TGetTablesReq_TableName_DEFAULT TPatternOrIdentifier + func (p *TGetTablesReq) GetTableName() TPatternOrIdentifier { - if !p.IsSetTableName() { - return TGetTablesReq_TableName_DEFAULT - } -return *p.TableName + if !p.IsSetTableName() { + return TGetTablesReq_TableName_DEFAULT + } + return *p.TableName } + var TGetTablesReq_TableTypes_DEFAULT []string func (p *TGetTablesReq) GetTableTypes() []string { - return p.TableTypes + return p.TableTypes } + var TGetTablesReq_GetDirectResults_DEFAULT *TSparkGetDirectResults + func (p *TGetTablesReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetTablesReq_GetDirectResults_DEFAULT - } -return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetTablesReq_GetDirectResults_DEFAULT + } + return p.GetDirectResults } + var TGetTablesReq_RunAsync_DEFAULT bool = false func (p *TGetTablesReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetTablesReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetTablesReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetTablesReq) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TGetTablesReq) IsSetTableName() bool { - return p.TableName != nil + return p.TableName != nil } func (p *TGetTablesReq) IsSetTableTypes() bool { - return p.TableTypes != nil + return p.TableTypes != nil } func (p *TGetTablesReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetTablesReq) IsSetRunAsync() bool { - return p.RunAsync != TGetTablesReq_RunAsync_DEFAULT + return p.RunAsync != TGetTablesReq_RunAsync_DEFAULT } func (p *TGetTablesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.LIST { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - return nil -} - -func (p *TGetTablesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetTablesReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.CatalogName = &temp -} - return nil -} - -func (p *TGetTablesReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.SchemaName = &temp -} - return nil -} - -func (p *TGetTablesReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.TableName = &temp -} - return nil -} - -func (p *TGetTablesReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]string, 0, size) - p.TableTypes = tSlice - for i := 0; i < size; i ++ { -var _elem66 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem66 = v -} - p.TableTypes = append(p.TableTypes, _elem66) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TGetTablesReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetTablesReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.RunAsync = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.LIST { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + return nil +} + +func (p *TGetTablesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetTablesReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TPatternOrIdentifier(v) + p.CatalogName = &temp + } + return nil +} + +func (p *TGetTablesReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := TPatternOrIdentifier(v) + p.SchemaName = &temp + } + return nil +} + +func (p *TGetTablesReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := TPatternOrIdentifier(v) + p.TableName = &temp + } + return nil +} + +func (p *TGetTablesReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.TableTypes = tSlice + for i := 0; i < size; i++ { + var _elem66 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem66 = v + } + p.TableTypes = append(p.TableTypes, _elem66) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TGetTablesReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetTablesReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.RunAsync = v + } + return nil } func (p *TGetTablesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTablesReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetTablesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetTablesReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TGetTablesReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } - } - return err + if p.IsSetCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) + } + } + return err } func (p *TGetTablesReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } - } - return err + if p.IsSetSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) + } + } + return err } func (p *TGetTablesReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTableName() { - if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) } - } - return err + if p.IsSetTableName() { + if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) + } + } + return err } func (p *TGetTablesReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTableTypes() { - if err := oprot.WriteFieldBegin(ctx, "tableTypes", thrift.LIST, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:tableTypes: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.TableTypes)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.TableTypes { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:tableTypes: ", p), err) } - } - return err + if p.IsSetTableTypes() { + if err := oprot.WriteFieldBegin(ctx, "tableTypes", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:tableTypes: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.TableTypes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TableTypes { + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:tableTypes: ", p), err) + } + } + return err } func (p *TGetTablesReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) + } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) + } + } + return err } func (p *TGetTablesReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) + } + } + return err } func (p *TGetTablesReq) Equals(other *TGetTablesReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { return false } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { return false } - } - if p.TableName != other.TableName { - if p.TableName == nil || other.TableName == nil { - return false - } - if (*p.TableName) != (*other.TableName) { return false } - } - if len(p.TableTypes) != len(other.TableTypes) { return false } - for i, _tgt := range p.TableTypes { - _src67 := other.TableTypes[i] - if _tgt != _src67 { return false } - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } - if p.RunAsync != other.RunAsync { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { + return false + } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { + return false + } + } + if p.TableName != other.TableName { + if p.TableName == nil || other.TableName == nil { + return false + } + if (*p.TableName) != (*other.TableName) { + return false + } + } + if len(p.TableTypes) != len(other.TableTypes) { + return false + } + for i, _tgt := range p.TableTypes { + _src67 := other.TableTypes[i] + if _tgt != _src67 { + return false + } + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { + return false + } + if p.RunAsync != other.RunAsync { + return false + } + return true } func (p *TGetTablesReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetTablesReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTablesReq(%+v)", *p) } func (p *TGetTablesReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetTablesResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetTablesResp() *TGetTablesResp { - return &TGetTablesResp{} + return &TGetTablesResp{} } var TGetTablesResp_Status_DEFAULT *TStatus + func (p *TGetTablesResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetTablesResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetTablesResp_Status_DEFAULT + } + return p.Status } + var TGetTablesResp_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetTablesResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetTablesResp_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetTablesResp_OperationHandle_DEFAULT + } + return p.OperationHandle } + var TGetTablesResp_DirectResults_DEFAULT *TSparkDirectResults + func (p *TGetTablesResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetTablesResp_DirectResults_DEFAULT - } -return p.DirectResults + if !p.IsSetDirectResults() { + return TGetTablesResp_DirectResults_DEFAULT + } + return p.DirectResults } func (p *TGetTablesResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetTablesResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetTablesResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetTablesResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TGetTablesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetTablesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetTablesResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TGetTablesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetTablesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetTablesResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetTablesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTablesResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetTablesResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetTablesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TGetTablesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) + } + } + return err } func (p *TGetTablesResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) + } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) + } + } + return err } func (p *TGetTablesResp) Equals(other *TGetTablesResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if !p.DirectResults.Equals(other.DirectResults) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + if !p.DirectResults.Equals(other.DirectResults) { + return false + } + return true } func (p *TGetTablesResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetTablesResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTablesResp(%+v)", *p) } func (p *TGetTablesResp) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - GetDirectResults +// - RunAsync type TGetTableTypesReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - // unused fields # 2 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + // unused fields # 2 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetTableTypesReq() *TGetTableTypesReq { - return &TGetTableTypesReq{} + return &TGetTableTypesReq{} } var TGetTableTypesReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetTableTypesReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetTableTypesReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetTableTypesReq_SessionHandle_DEFAULT + } + return p.SessionHandle } + var TGetTableTypesReq_GetDirectResults_DEFAULT *TSparkGetDirectResults + func (p *TGetTableTypesReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetTableTypesReq_GetDirectResults_DEFAULT - } -return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetTableTypesReq_GetDirectResults_DEFAULT + } + return p.GetDirectResults } + var TGetTableTypesReq_RunAsync_DEFAULT bool = false func (p *TGetTableTypesReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetTableTypesReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetTableTypesReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetTableTypesReq) IsSetRunAsync() bool { - return p.RunAsync != TGetTableTypesReq_RunAsync_DEFAULT + return p.RunAsync != TGetTableTypesReq_RunAsync_DEFAULT } func (p *TGetTableTypesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - return nil -} - -func (p *TGetTableTypesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetTableTypesReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetTableTypesReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.RunAsync = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + return nil +} + +func (p *TGetTableTypesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetTableTypesReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetTableTypesReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.RunAsync = v + } + return nil } func (p *TGetTableTypesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTableTypesReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetTableTypesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetTableTypesReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TGetTableTypesReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) + } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) + } + } + return err } func (p *TGetTableTypesReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) + } + } + return err } func (p *TGetTableTypesReq) Equals(other *TGetTableTypesReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } - if p.RunAsync != other.RunAsync { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { + return false + } + if p.RunAsync != other.RunAsync { + return false + } + return true } func (p *TGetTableTypesReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetTableTypesReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTableTypesReq(%+v)", *p) } func (p *TGetTableTypesReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetTableTypesResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetTableTypesResp() *TGetTableTypesResp { - return &TGetTableTypesResp{} + return &TGetTableTypesResp{} } var TGetTableTypesResp_Status_DEFAULT *TStatus + func (p *TGetTableTypesResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetTableTypesResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetTableTypesResp_Status_DEFAULT + } + return p.Status } + var TGetTableTypesResp_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetTableTypesResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetTableTypesResp_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetTableTypesResp_OperationHandle_DEFAULT + } + return p.OperationHandle } + var TGetTableTypesResp_DirectResults_DEFAULT *TSparkDirectResults + func (p *TGetTableTypesResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetTableTypesResp_DirectResults_DEFAULT - } -return p.DirectResults + if !p.IsSetDirectResults() { + return TGetTableTypesResp_DirectResults_DEFAULT + } + return p.DirectResults } func (p *TGetTableTypesResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetTableTypesResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetTableTypesResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetTableTypesResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TGetTableTypesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetTableTypesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetTableTypesResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TGetTableTypesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetTableTypesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetTableTypesResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetTableTypesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTableTypesResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetTableTypesResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetTableTypesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TGetTableTypesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) + } + } + return err } func (p *TGetTableTypesResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) + } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) + } + } + return err } func (p *TGetTableTypesResp) Equals(other *TGetTableTypesResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if !p.DirectResults.Equals(other.DirectResults) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + if !p.DirectResults.Equals(other.DirectResults) { + return false + } + return true } func (p *TGetTableTypesResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetTableTypesResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTableTypesResp(%+v)", *p) } func (p *TGetTableTypesResp) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - CatalogName -// - SchemaName -// - TableName -// - ColumnName -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - CatalogName +// - SchemaName +// - TableName +// - ColumnName +// - GetDirectResults +// - RunAsync type TGetColumnsReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` - SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` - TableName *TPatternOrIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` - ColumnName *TPatternOrIdentifier `thrift:"columnName,5" db:"columnName" json:"columnName,omitempty"` - // unused fields # 6 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` + TableName *TPatternOrIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` + ColumnName *TPatternOrIdentifier `thrift:"columnName,5" db:"columnName" json:"columnName,omitempty"` + // unused fields # 6 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetColumnsReq() *TGetColumnsReq { - return &TGetColumnsReq{} + return &TGetColumnsReq{} } var TGetColumnsReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetColumnsReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetColumnsReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetColumnsReq_SessionHandle_DEFAULT + } + return p.SessionHandle } + var TGetColumnsReq_CatalogName_DEFAULT TIdentifier + func (p *TGetColumnsReq) GetCatalogName() TIdentifier { - if !p.IsSetCatalogName() { - return TGetColumnsReq_CatalogName_DEFAULT - } -return *p.CatalogName + if !p.IsSetCatalogName() { + return TGetColumnsReq_CatalogName_DEFAULT + } + return *p.CatalogName } + var TGetColumnsReq_SchemaName_DEFAULT TPatternOrIdentifier + func (p *TGetColumnsReq) GetSchemaName() TPatternOrIdentifier { - if !p.IsSetSchemaName() { - return TGetColumnsReq_SchemaName_DEFAULT - } -return *p.SchemaName + if !p.IsSetSchemaName() { + return TGetColumnsReq_SchemaName_DEFAULT + } + return *p.SchemaName } + var TGetColumnsReq_TableName_DEFAULT TPatternOrIdentifier + func (p *TGetColumnsReq) GetTableName() TPatternOrIdentifier { - if !p.IsSetTableName() { - return TGetColumnsReq_TableName_DEFAULT - } -return *p.TableName + if !p.IsSetTableName() { + return TGetColumnsReq_TableName_DEFAULT + } + return *p.TableName } + var TGetColumnsReq_ColumnName_DEFAULT TPatternOrIdentifier + func (p *TGetColumnsReq) GetColumnName() TPatternOrIdentifier { - if !p.IsSetColumnName() { - return TGetColumnsReq_ColumnName_DEFAULT - } -return *p.ColumnName + if !p.IsSetColumnName() { + return TGetColumnsReq_ColumnName_DEFAULT + } + return *p.ColumnName } + var TGetColumnsReq_GetDirectResults_DEFAULT *TSparkGetDirectResults + func (p *TGetColumnsReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetColumnsReq_GetDirectResults_DEFAULT - } -return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetColumnsReq_GetDirectResults_DEFAULT + } + return p.GetDirectResults } + var TGetColumnsReq_RunAsync_DEFAULT bool = false func (p *TGetColumnsReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetColumnsReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetColumnsReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetColumnsReq) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TGetColumnsReq) IsSetTableName() bool { - return p.TableName != nil + return p.TableName != nil } func (p *TGetColumnsReq) IsSetColumnName() bool { - return p.ColumnName != nil + return p.ColumnName != nil } func (p *TGetColumnsReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetColumnsReq) IsSetRunAsync() bool { - return p.RunAsync != TGetColumnsReq_RunAsync_DEFAULT + return p.RunAsync != TGetColumnsReq_RunAsync_DEFAULT } func (p *TGetColumnsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - return nil -} - -func (p *TGetColumnsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetColumnsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TIdentifier(v) - p.CatalogName = &temp -} - return nil -} - -func (p *TGetColumnsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.SchemaName = &temp -} - return nil -} - -func (p *TGetColumnsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.TableName = &temp -} - return nil -} - -func (p *TGetColumnsReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.ColumnName = &temp -} - return nil -} - -func (p *TGetColumnsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetColumnsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.RunAsync = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + return nil +} + +func (p *TGetColumnsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetColumnsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TIdentifier(v) + p.CatalogName = &temp + } + return nil +} + +func (p *TGetColumnsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := TPatternOrIdentifier(v) + p.SchemaName = &temp + } + return nil +} + +func (p *TGetColumnsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := TPatternOrIdentifier(v) + p.TableName = &temp + } + return nil +} + +func (p *TGetColumnsReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + temp := TPatternOrIdentifier(v) + p.ColumnName = &temp + } + return nil +} + +func (p *TGetColumnsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetColumnsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.RunAsync = v + } + return nil } func (p *TGetColumnsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetColumnsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetColumnsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetColumnsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TGetColumnsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } - } - return err + if p.IsSetCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) + } + } + return err } func (p *TGetColumnsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } - } - return err + if p.IsSetSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) + } + } + return err } func (p *TGetColumnsReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTableName() { - if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) } - } - return err + if p.IsSetTableName() { + if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) + } + } + return err } func (p *TGetColumnsReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetColumnName() { - if err := oprot.WriteFieldBegin(ctx, "columnName", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ColumnName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.columnName (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnName: ", p), err) } - } - return err + if p.IsSetColumnName() { + if err := oprot.WriteFieldBegin(ctx, "columnName", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.ColumnName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.columnName (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnName: ", p), err) + } + } + return err } func (p *TGetColumnsReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) + } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) + } + } + return err } func (p *TGetColumnsReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) + } + } + return err } func (p *TGetColumnsReq) Equals(other *TGetColumnsReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { return false } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { return false } - } - if p.TableName != other.TableName { - if p.TableName == nil || other.TableName == nil { - return false - } - if (*p.TableName) != (*other.TableName) { return false } - } - if p.ColumnName != other.ColumnName { - if p.ColumnName == nil || other.ColumnName == nil { - return false - } - if (*p.ColumnName) != (*other.ColumnName) { return false } - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } - if p.RunAsync != other.RunAsync { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { + return false + } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { + return false + } + } + if p.TableName != other.TableName { + if p.TableName == nil || other.TableName == nil { + return false + } + if (*p.TableName) != (*other.TableName) { + return false + } + } + if p.ColumnName != other.ColumnName { + if p.ColumnName == nil || other.ColumnName == nil { + return false + } + if (*p.ColumnName) != (*other.ColumnName) { + return false + } + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { + return false + } + if p.RunAsync != other.RunAsync { + return false + } + return true } func (p *TGetColumnsReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetColumnsReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetColumnsReq(%+v)", *p) } func (p *TGetColumnsReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetColumnsResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetColumnsResp() *TGetColumnsResp { - return &TGetColumnsResp{} + return &TGetColumnsResp{} } var TGetColumnsResp_Status_DEFAULT *TStatus + func (p *TGetColumnsResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetColumnsResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetColumnsResp_Status_DEFAULT + } + return p.Status } + var TGetColumnsResp_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetColumnsResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetColumnsResp_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetColumnsResp_OperationHandle_DEFAULT + } + return p.OperationHandle } + var TGetColumnsResp_DirectResults_DEFAULT *TSparkDirectResults + func (p *TGetColumnsResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetColumnsResp_DirectResults_DEFAULT - } -return p.DirectResults + if !p.IsSetDirectResults() { + return TGetColumnsResp_DirectResults_DEFAULT + } + return p.DirectResults } func (p *TGetColumnsResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetColumnsResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetColumnsResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetColumnsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TGetColumnsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetColumnsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetColumnsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TGetColumnsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetColumnsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetColumnsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetColumnsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetColumnsResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetColumnsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetColumnsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TGetColumnsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) + } + } + return err } func (p *TGetColumnsResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) + } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) + } + } + return err } func (p *TGetColumnsResp) Equals(other *TGetColumnsResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if !p.DirectResults.Equals(other.DirectResults) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + if !p.DirectResults.Equals(other.DirectResults) { + return false + } + return true } func (p *TGetColumnsResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetColumnsResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetColumnsResp(%+v)", *p) } func (p *TGetColumnsResp) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - CatalogName -// - SchemaName -// - FunctionName -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - CatalogName +// - SchemaName +// - FunctionName +// - GetDirectResults +// - RunAsync type TGetFunctionsReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` - SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` - FunctionName TPatternOrIdentifier `thrift:"functionName,4,required" db:"functionName" json:"functionName"` - // unused fields # 5 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` + FunctionName TPatternOrIdentifier `thrift:"functionName,4,required" db:"functionName" json:"functionName"` + // unused fields # 5 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetFunctionsReq() *TGetFunctionsReq { - return &TGetFunctionsReq{} + return &TGetFunctionsReq{} } var TGetFunctionsReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetFunctionsReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetFunctionsReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetFunctionsReq_SessionHandle_DEFAULT + } + return p.SessionHandle } + var TGetFunctionsReq_CatalogName_DEFAULT TIdentifier + func (p *TGetFunctionsReq) GetCatalogName() TIdentifier { - if !p.IsSetCatalogName() { - return TGetFunctionsReq_CatalogName_DEFAULT - } -return *p.CatalogName + if !p.IsSetCatalogName() { + return TGetFunctionsReq_CatalogName_DEFAULT + } + return *p.CatalogName } + var TGetFunctionsReq_SchemaName_DEFAULT TPatternOrIdentifier + func (p *TGetFunctionsReq) GetSchemaName() TPatternOrIdentifier { - if !p.IsSetSchemaName() { - return TGetFunctionsReq_SchemaName_DEFAULT - } -return *p.SchemaName + if !p.IsSetSchemaName() { + return TGetFunctionsReq_SchemaName_DEFAULT + } + return *p.SchemaName } func (p *TGetFunctionsReq) GetFunctionName() TPatternOrIdentifier { - return p.FunctionName + return p.FunctionName } + var TGetFunctionsReq_GetDirectResults_DEFAULT *TSparkGetDirectResults + func (p *TGetFunctionsReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetFunctionsReq_GetDirectResults_DEFAULT - } -return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetFunctionsReq_GetDirectResults_DEFAULT + } + return p.GetDirectResults } + var TGetFunctionsReq_RunAsync_DEFAULT bool = false func (p *TGetFunctionsReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetFunctionsReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetFunctionsReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetFunctionsReq) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TGetFunctionsReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetFunctionsReq) IsSetRunAsync() bool { - return p.RunAsync != TGetFunctionsReq_RunAsync_DEFAULT + return p.RunAsync != TGetFunctionsReq_RunAsync_DEFAULT } func (p *TGetFunctionsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - var issetFunctionName bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - issetFunctionName = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - if !issetFunctionName{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FunctionName is not set")); - } - return nil -} - -func (p *TGetFunctionsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetFunctionsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TIdentifier(v) - p.CatalogName = &temp -} - return nil -} - -func (p *TGetFunctionsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.SchemaName = &temp -} - return nil -} - -func (p *TGetFunctionsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - temp := TPatternOrIdentifier(v) - p.FunctionName = temp -} - return nil -} - -func (p *TGetFunctionsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetFunctionsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.RunAsync = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + var issetFunctionName bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + issetFunctionName = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + if !issetFunctionName { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FunctionName is not set")) + } + return nil +} + +func (p *TGetFunctionsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetFunctionsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TIdentifier(v) + p.CatalogName = &temp + } + return nil +} + +func (p *TGetFunctionsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := TPatternOrIdentifier(v) + p.SchemaName = &temp + } + return nil +} + +func (p *TGetFunctionsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := TPatternOrIdentifier(v) + p.FunctionName = temp + } + return nil +} + +func (p *TGetFunctionsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetFunctionsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.RunAsync = v + } + return nil } func (p *TGetFunctionsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetFunctionsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetFunctionsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetFunctionsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TGetFunctionsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } - } - return err + if p.IsSetCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) + } + } + return err } func (p *TGetFunctionsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } - } - return err + if p.IsSetSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) + } + } + return err } func (p *TGetFunctionsReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "functionName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:functionName: ", p), err) } - if err := oprot.WriteString(ctx, string(p.FunctionName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.functionName (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:functionName: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "functionName", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:functionName: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.FunctionName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.functionName (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:functionName: ", p), err) + } + return err } func (p *TGetFunctionsReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) + } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) + } + } + return err } func (p *TGetFunctionsReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) + } + } + return err } func (p *TGetFunctionsReq) Equals(other *TGetFunctionsReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { return false } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { return false } - } - if p.FunctionName != other.FunctionName { return false } - if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } - if p.RunAsync != other.RunAsync { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { + return false + } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { + return false + } + } + if p.FunctionName != other.FunctionName { + return false + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { + return false + } + if p.RunAsync != other.RunAsync { + return false + } + return true } func (p *TGetFunctionsReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetFunctionsReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetFunctionsReq(%+v)", *p) } func (p *TGetFunctionsReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetFunctionsResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetFunctionsResp() *TGetFunctionsResp { - return &TGetFunctionsResp{} + return &TGetFunctionsResp{} } var TGetFunctionsResp_Status_DEFAULT *TStatus + func (p *TGetFunctionsResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetFunctionsResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetFunctionsResp_Status_DEFAULT + } + return p.Status } + var TGetFunctionsResp_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetFunctionsResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetFunctionsResp_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetFunctionsResp_OperationHandle_DEFAULT + } + return p.OperationHandle } + var TGetFunctionsResp_DirectResults_DEFAULT *TSparkDirectResults + func (p *TGetFunctionsResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetFunctionsResp_DirectResults_DEFAULT - } -return p.DirectResults + if !p.IsSetDirectResults() { + return TGetFunctionsResp_DirectResults_DEFAULT + } + return p.DirectResults } func (p *TGetFunctionsResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetFunctionsResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetFunctionsResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetFunctionsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TGetFunctionsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetFunctionsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetFunctionsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TGetFunctionsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetFunctionsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetFunctionsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetFunctionsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetFunctionsResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetFunctionsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetFunctionsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TGetFunctionsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) + } + } + return err } func (p *TGetFunctionsResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) + } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) + } + } + return err } func (p *TGetFunctionsResp) Equals(other *TGetFunctionsResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if !p.DirectResults.Equals(other.DirectResults) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + if !p.DirectResults.Equals(other.DirectResults) { + return false + } + return true } func (p *TGetFunctionsResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetFunctionsResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetFunctionsResp(%+v)", *p) } func (p *TGetFunctionsResp) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - CatalogName -// - SchemaName -// - TableName -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - CatalogName +// - SchemaName +// - TableName +// - GetDirectResults +// - RunAsync type TGetPrimaryKeysReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` - SchemaName *TIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` - TableName *TIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` - // unused fields # 5 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` + TableName *TIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` + // unused fields # 5 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetPrimaryKeysReq() *TGetPrimaryKeysReq { - return &TGetPrimaryKeysReq{} + return &TGetPrimaryKeysReq{} } var TGetPrimaryKeysReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetPrimaryKeysReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetPrimaryKeysReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetPrimaryKeysReq_SessionHandle_DEFAULT + } + return p.SessionHandle } + var TGetPrimaryKeysReq_CatalogName_DEFAULT TIdentifier + func (p *TGetPrimaryKeysReq) GetCatalogName() TIdentifier { - if !p.IsSetCatalogName() { - return TGetPrimaryKeysReq_CatalogName_DEFAULT - } -return *p.CatalogName + if !p.IsSetCatalogName() { + return TGetPrimaryKeysReq_CatalogName_DEFAULT + } + return *p.CatalogName } + var TGetPrimaryKeysReq_SchemaName_DEFAULT TIdentifier + func (p *TGetPrimaryKeysReq) GetSchemaName() TIdentifier { - if !p.IsSetSchemaName() { - return TGetPrimaryKeysReq_SchemaName_DEFAULT - } -return *p.SchemaName + if !p.IsSetSchemaName() { + return TGetPrimaryKeysReq_SchemaName_DEFAULT + } + return *p.SchemaName } + var TGetPrimaryKeysReq_TableName_DEFAULT TIdentifier + func (p *TGetPrimaryKeysReq) GetTableName() TIdentifier { - if !p.IsSetTableName() { - return TGetPrimaryKeysReq_TableName_DEFAULT - } -return *p.TableName + if !p.IsSetTableName() { + return TGetPrimaryKeysReq_TableName_DEFAULT + } + return *p.TableName } + var TGetPrimaryKeysReq_GetDirectResults_DEFAULT *TSparkGetDirectResults + func (p *TGetPrimaryKeysReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetPrimaryKeysReq_GetDirectResults_DEFAULT - } -return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetPrimaryKeysReq_GetDirectResults_DEFAULT + } + return p.GetDirectResults } + var TGetPrimaryKeysReq_RunAsync_DEFAULT bool = false func (p *TGetPrimaryKeysReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetPrimaryKeysReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetPrimaryKeysReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetPrimaryKeysReq) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TGetPrimaryKeysReq) IsSetTableName() bool { - return p.TableName != nil + return p.TableName != nil } func (p *TGetPrimaryKeysReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetPrimaryKeysReq) IsSetRunAsync() bool { - return p.RunAsync != TGetPrimaryKeysReq_RunAsync_DEFAULT + return p.RunAsync != TGetPrimaryKeysReq_RunAsync_DEFAULT } func (p *TGetPrimaryKeysReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TIdentifier(v) - p.CatalogName = &temp -} - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := TIdentifier(v) - p.SchemaName = &temp -} - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - temp := TIdentifier(v) - p.TableName = &temp -} - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.RunAsync = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + return nil +} + +func (p *TGetPrimaryKeysReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetPrimaryKeysReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TIdentifier(v) + p.CatalogName = &temp + } + return nil +} + +func (p *TGetPrimaryKeysReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := TIdentifier(v) + p.SchemaName = &temp + } + return nil +} + +func (p *TGetPrimaryKeysReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := TIdentifier(v) + p.TableName = &temp + } + return nil +} + +func (p *TGetPrimaryKeysReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetPrimaryKeysReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.RunAsync = v + } + return nil } func (p *TGetPrimaryKeysReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetPrimaryKeysReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetPrimaryKeysReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetPrimaryKeysReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TGetPrimaryKeysReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } - } - return err + if p.IsSetCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) + } + } + return err } func (p *TGetPrimaryKeysReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } - } - return err + if p.IsSetSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) + } + } + return err } func (p *TGetPrimaryKeysReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTableName() { - if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) } - } - return err + if p.IsSetTableName() { + if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) + } + } + return err } func (p *TGetPrimaryKeysReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) + } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) + } + } + return err } func (p *TGetPrimaryKeysReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) + } + } + return err } func (p *TGetPrimaryKeysReq) Equals(other *TGetPrimaryKeysReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { return false } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { return false } - } - if p.TableName != other.TableName { - if p.TableName == nil || other.TableName == nil { - return false - } - if (*p.TableName) != (*other.TableName) { return false } - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } - if p.RunAsync != other.RunAsync { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { + return false + } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { + return false + } + } + if p.TableName != other.TableName { + if p.TableName == nil || other.TableName == nil { + return false + } + if (*p.TableName) != (*other.TableName) { + return false + } + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { + return false + } + if p.RunAsync != other.RunAsync { + return false + } + return true } func (p *TGetPrimaryKeysReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetPrimaryKeysReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetPrimaryKeysReq(%+v)", *p) } func (p *TGetPrimaryKeysReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetPrimaryKeysResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetPrimaryKeysResp() *TGetPrimaryKeysResp { - return &TGetPrimaryKeysResp{} + return &TGetPrimaryKeysResp{} } var TGetPrimaryKeysResp_Status_DEFAULT *TStatus + func (p *TGetPrimaryKeysResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetPrimaryKeysResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetPrimaryKeysResp_Status_DEFAULT + } + return p.Status } + var TGetPrimaryKeysResp_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetPrimaryKeysResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetPrimaryKeysResp_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetPrimaryKeysResp_OperationHandle_DEFAULT + } + return p.OperationHandle } + var TGetPrimaryKeysResp_DirectResults_DEFAULT *TSparkDirectResults + func (p *TGetPrimaryKeysResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetPrimaryKeysResp_DirectResults_DEFAULT - } -return p.DirectResults + if !p.IsSetDirectResults() { + return TGetPrimaryKeysResp_DirectResults_DEFAULT + } + return p.DirectResults } func (p *TGetPrimaryKeysResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetPrimaryKeysResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetPrimaryKeysResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetPrimaryKeysResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TGetPrimaryKeysResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetPrimaryKeysResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetPrimaryKeysResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TGetPrimaryKeysResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetPrimaryKeysResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetPrimaryKeysResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetPrimaryKeysResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetPrimaryKeysResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetPrimaryKeysResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetPrimaryKeysResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TGetPrimaryKeysResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) + } + } + return err } func (p *TGetPrimaryKeysResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) + } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) + } + } + return err } func (p *TGetPrimaryKeysResp) Equals(other *TGetPrimaryKeysResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if !p.DirectResults.Equals(other.DirectResults) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + if !p.DirectResults.Equals(other.DirectResults) { + return false + } + return true } func (p *TGetPrimaryKeysResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetPrimaryKeysResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetPrimaryKeysResp(%+v)", *p) } func (p *TGetPrimaryKeysResp) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - ParentCatalogName -// - ParentSchemaName -// - ParentTableName -// - ForeignCatalogName -// - ForeignSchemaName -// - ForeignTableName -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - ParentCatalogName +// - ParentSchemaName +// - ParentTableName +// - ForeignCatalogName +// - ForeignSchemaName +// - ForeignTableName +// - GetDirectResults +// - RunAsync type TGetCrossReferenceReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - ParentCatalogName *TIdentifier `thrift:"parentCatalogName,2" db:"parentCatalogName" json:"parentCatalogName,omitempty"` - ParentSchemaName *TIdentifier `thrift:"parentSchemaName,3" db:"parentSchemaName" json:"parentSchemaName,omitempty"` - ParentTableName *TIdentifier `thrift:"parentTableName,4" db:"parentTableName" json:"parentTableName,omitempty"` - ForeignCatalogName *TIdentifier `thrift:"foreignCatalogName,5" db:"foreignCatalogName" json:"foreignCatalogName,omitempty"` - ForeignSchemaName *TIdentifier `thrift:"foreignSchemaName,6" db:"foreignSchemaName" json:"foreignSchemaName,omitempty"` - ForeignTableName *TIdentifier `thrift:"foreignTableName,7" db:"foreignTableName" json:"foreignTableName,omitempty"` - // unused fields # 8 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + ParentCatalogName *TIdentifier `thrift:"parentCatalogName,2" db:"parentCatalogName" json:"parentCatalogName,omitempty"` + ParentSchemaName *TIdentifier `thrift:"parentSchemaName,3" db:"parentSchemaName" json:"parentSchemaName,omitempty"` + ParentTableName *TIdentifier `thrift:"parentTableName,4" db:"parentTableName" json:"parentTableName,omitempty"` + ForeignCatalogName *TIdentifier `thrift:"foreignCatalogName,5" db:"foreignCatalogName" json:"foreignCatalogName,omitempty"` + ForeignSchemaName *TIdentifier `thrift:"foreignSchemaName,6" db:"foreignSchemaName" json:"foreignSchemaName,omitempty"` + ForeignTableName *TIdentifier `thrift:"foreignTableName,7" db:"foreignTableName" json:"foreignTableName,omitempty"` + // unused fields # 8 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetCrossReferenceReq() *TGetCrossReferenceReq { - return &TGetCrossReferenceReq{} + return &TGetCrossReferenceReq{} } var TGetCrossReferenceReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetCrossReferenceReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetCrossReferenceReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetCrossReferenceReq_SessionHandle_DEFAULT + } + return p.SessionHandle } + var TGetCrossReferenceReq_ParentCatalogName_DEFAULT TIdentifier + func (p *TGetCrossReferenceReq) GetParentCatalogName() TIdentifier { - if !p.IsSetParentCatalogName() { - return TGetCrossReferenceReq_ParentCatalogName_DEFAULT - } -return *p.ParentCatalogName + if !p.IsSetParentCatalogName() { + return TGetCrossReferenceReq_ParentCatalogName_DEFAULT + } + return *p.ParentCatalogName } + var TGetCrossReferenceReq_ParentSchemaName_DEFAULT TIdentifier + func (p *TGetCrossReferenceReq) GetParentSchemaName() TIdentifier { - if !p.IsSetParentSchemaName() { - return TGetCrossReferenceReq_ParentSchemaName_DEFAULT - } -return *p.ParentSchemaName + if !p.IsSetParentSchemaName() { + return TGetCrossReferenceReq_ParentSchemaName_DEFAULT + } + return *p.ParentSchemaName } + var TGetCrossReferenceReq_ParentTableName_DEFAULT TIdentifier + func (p *TGetCrossReferenceReq) GetParentTableName() TIdentifier { - if !p.IsSetParentTableName() { - return TGetCrossReferenceReq_ParentTableName_DEFAULT - } -return *p.ParentTableName + if !p.IsSetParentTableName() { + return TGetCrossReferenceReq_ParentTableName_DEFAULT + } + return *p.ParentTableName } + var TGetCrossReferenceReq_ForeignCatalogName_DEFAULT TIdentifier + func (p *TGetCrossReferenceReq) GetForeignCatalogName() TIdentifier { - if !p.IsSetForeignCatalogName() { - return TGetCrossReferenceReq_ForeignCatalogName_DEFAULT - } -return *p.ForeignCatalogName + if !p.IsSetForeignCatalogName() { + return TGetCrossReferenceReq_ForeignCatalogName_DEFAULT + } + return *p.ForeignCatalogName } + var TGetCrossReferenceReq_ForeignSchemaName_DEFAULT TIdentifier + func (p *TGetCrossReferenceReq) GetForeignSchemaName() TIdentifier { - if !p.IsSetForeignSchemaName() { - return TGetCrossReferenceReq_ForeignSchemaName_DEFAULT - } -return *p.ForeignSchemaName + if !p.IsSetForeignSchemaName() { + return TGetCrossReferenceReq_ForeignSchemaName_DEFAULT + } + return *p.ForeignSchemaName } + var TGetCrossReferenceReq_ForeignTableName_DEFAULT TIdentifier + func (p *TGetCrossReferenceReq) GetForeignTableName() TIdentifier { - if !p.IsSetForeignTableName() { - return TGetCrossReferenceReq_ForeignTableName_DEFAULT - } -return *p.ForeignTableName + if !p.IsSetForeignTableName() { + return TGetCrossReferenceReq_ForeignTableName_DEFAULT + } + return *p.ForeignTableName } + var TGetCrossReferenceReq_GetDirectResults_DEFAULT *TSparkGetDirectResults + func (p *TGetCrossReferenceReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetCrossReferenceReq_GetDirectResults_DEFAULT - } -return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetCrossReferenceReq_GetDirectResults_DEFAULT + } + return p.GetDirectResults } + var TGetCrossReferenceReq_RunAsync_DEFAULT bool = false func (p *TGetCrossReferenceReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetCrossReferenceReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetCrossReferenceReq) IsSetParentCatalogName() bool { - return p.ParentCatalogName != nil + return p.ParentCatalogName != nil } func (p *TGetCrossReferenceReq) IsSetParentSchemaName() bool { - return p.ParentSchemaName != nil + return p.ParentSchemaName != nil } func (p *TGetCrossReferenceReq) IsSetParentTableName() bool { - return p.ParentTableName != nil + return p.ParentTableName != nil } func (p *TGetCrossReferenceReq) IsSetForeignCatalogName() bool { - return p.ForeignCatalogName != nil + return p.ForeignCatalogName != nil } func (p *TGetCrossReferenceReq) IsSetForeignSchemaName() bool { - return p.ForeignSchemaName != nil + return p.ForeignSchemaName != nil } func (p *TGetCrossReferenceReq) IsSetForeignTableName() bool { - return p.ForeignTableName != nil + return p.ForeignTableName != nil } func (p *TGetCrossReferenceReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetCrossReferenceReq) IsSetRunAsync() bool { - return p.RunAsync != TGetCrossReferenceReq_RunAsync_DEFAULT + return p.RunAsync != TGetCrossReferenceReq_RunAsync_DEFAULT } func (p *TGetCrossReferenceReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRING { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.STRING { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - return nil -} - -func (p *TGetCrossReferenceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetCrossReferenceReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TIdentifier(v) - p.ParentCatalogName = &temp -} - return nil -} - -func (p *TGetCrossReferenceReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - temp := TIdentifier(v) - p.ParentSchemaName = &temp -} - return nil -} - -func (p *TGetCrossReferenceReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - temp := TIdentifier(v) - p.ParentTableName = &temp -} - return nil -} - -func (p *TGetCrossReferenceReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - temp := TIdentifier(v) - p.ForeignCatalogName = &temp -} - return nil -} - -func (p *TGetCrossReferenceReq) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) -} else { - temp := TIdentifier(v) - p.ForeignSchemaName = &temp -} - return nil -} - -func (p *TGetCrossReferenceReq) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 7: ", err) -} else { - temp := TIdentifier(v) - p.ForeignTableName = &temp -} - return nil -} - -func (p *TGetCrossReferenceReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetCrossReferenceReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.RunAsync = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TIdentifier(v) + p.ParentCatalogName = &temp + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + temp := TIdentifier(v) + p.ParentSchemaName = &temp + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := TIdentifier(v) + p.ParentTableName = &temp + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + temp := TIdentifier(v) + p.ForeignCatalogName = &temp + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + temp := TIdentifier(v) + p.ForeignSchemaName = &temp + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + temp := TIdentifier(v) + p.ForeignTableName = &temp + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.RunAsync = v + } + return nil } func (p *TGetCrossReferenceReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetCrossReferenceReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - if err := p.writeField7(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetCrossReferenceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField6(ctx, oprot); err != nil { + return err + } + if err := p.writeField7(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetCrossReferenceReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TGetCrossReferenceReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetParentCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "parentCatalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parentCatalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ParentCatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.parentCatalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parentCatalogName: ", p), err) } - } - return err + if p.IsSetParentCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "parentCatalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parentCatalogName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.ParentCatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parentCatalogName (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parentCatalogName: ", p), err) + } + } + return err } func (p *TGetCrossReferenceReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetParentSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "parentSchemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parentSchemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ParentSchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.parentSchemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parentSchemaName: ", p), err) } - } - return err + if p.IsSetParentSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "parentSchemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parentSchemaName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.ParentSchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parentSchemaName (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parentSchemaName: ", p), err) + } + } + return err } func (p *TGetCrossReferenceReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetParentTableName() { - if err := oprot.WriteFieldBegin(ctx, "parentTableName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:parentTableName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ParentTableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.parentTableName (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:parentTableName: ", p), err) } - } - return err + if p.IsSetParentTableName() { + if err := oprot.WriteFieldBegin(ctx, "parentTableName", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:parentTableName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.ParentTableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parentTableName (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:parentTableName: ", p), err) + } + } + return err } func (p *TGetCrossReferenceReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetForeignCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "foreignCatalogName", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:foreignCatalogName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ForeignCatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.foreignCatalogName (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:foreignCatalogName: ", p), err) } - } - return err + if p.IsSetForeignCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "foreignCatalogName", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:foreignCatalogName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.ForeignCatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.foreignCatalogName (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:foreignCatalogName: ", p), err) + } + } + return err } func (p *TGetCrossReferenceReq) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetForeignSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "foreignSchemaName", thrift.STRING, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:foreignSchemaName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ForeignSchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.foreignSchemaName (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:foreignSchemaName: ", p), err) } - } - return err + if p.IsSetForeignSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "foreignSchemaName", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:foreignSchemaName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.ForeignSchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.foreignSchemaName (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:foreignSchemaName: ", p), err) + } + } + return err } func (p *TGetCrossReferenceReq) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetForeignTableName() { - if err := oprot.WriteFieldBegin(ctx, "foreignTableName", thrift.STRING, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:foreignTableName: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ForeignTableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.foreignTableName (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:foreignTableName: ", p), err) } - } - return err + if p.IsSetForeignTableName() { + if err := oprot.WriteFieldBegin(ctx, "foreignTableName", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:foreignTableName: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.ForeignTableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.foreignTableName (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:foreignTableName: ", p), err) + } + } + return err } func (p *TGetCrossReferenceReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) + } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) + } + } + return err } func (p *TGetCrossReferenceReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) + } + } + return err } func (p *TGetCrossReferenceReq) Equals(other *TGetCrossReferenceReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.ParentCatalogName != other.ParentCatalogName { - if p.ParentCatalogName == nil || other.ParentCatalogName == nil { - return false - } - if (*p.ParentCatalogName) != (*other.ParentCatalogName) { return false } - } - if p.ParentSchemaName != other.ParentSchemaName { - if p.ParentSchemaName == nil || other.ParentSchemaName == nil { - return false - } - if (*p.ParentSchemaName) != (*other.ParentSchemaName) { return false } - } - if p.ParentTableName != other.ParentTableName { - if p.ParentTableName == nil || other.ParentTableName == nil { - return false - } - if (*p.ParentTableName) != (*other.ParentTableName) { return false } - } - if p.ForeignCatalogName != other.ForeignCatalogName { - if p.ForeignCatalogName == nil || other.ForeignCatalogName == nil { - return false - } - if (*p.ForeignCatalogName) != (*other.ForeignCatalogName) { return false } - } - if p.ForeignSchemaName != other.ForeignSchemaName { - if p.ForeignSchemaName == nil || other.ForeignSchemaName == nil { - return false - } - if (*p.ForeignSchemaName) != (*other.ForeignSchemaName) { return false } - } - if p.ForeignTableName != other.ForeignTableName { - if p.ForeignTableName == nil || other.ForeignTableName == nil { - return false - } - if (*p.ForeignTableName) != (*other.ForeignTableName) { return false } - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } - if p.RunAsync != other.RunAsync { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if p.ParentCatalogName != other.ParentCatalogName { + if p.ParentCatalogName == nil || other.ParentCatalogName == nil { + return false + } + if (*p.ParentCatalogName) != (*other.ParentCatalogName) { + return false + } + } + if p.ParentSchemaName != other.ParentSchemaName { + if p.ParentSchemaName == nil || other.ParentSchemaName == nil { + return false + } + if (*p.ParentSchemaName) != (*other.ParentSchemaName) { + return false + } + } + if p.ParentTableName != other.ParentTableName { + if p.ParentTableName == nil || other.ParentTableName == nil { + return false + } + if (*p.ParentTableName) != (*other.ParentTableName) { + return false + } + } + if p.ForeignCatalogName != other.ForeignCatalogName { + if p.ForeignCatalogName == nil || other.ForeignCatalogName == nil { + return false + } + if (*p.ForeignCatalogName) != (*other.ForeignCatalogName) { + return false + } + } + if p.ForeignSchemaName != other.ForeignSchemaName { + if p.ForeignSchemaName == nil || other.ForeignSchemaName == nil { + return false + } + if (*p.ForeignSchemaName) != (*other.ForeignSchemaName) { + return false + } + } + if p.ForeignTableName != other.ForeignTableName { + if p.ForeignTableName == nil || other.ForeignTableName == nil { + return false + } + if (*p.ForeignTableName) != (*other.ForeignTableName) { + return false + } + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { + return false + } + if p.RunAsync != other.RunAsync { + return false + } + return true } func (p *TGetCrossReferenceReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetCrossReferenceReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetCrossReferenceReq(%+v)", *p) } func (p *TGetCrossReferenceReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetCrossReferenceResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetCrossReferenceResp() *TGetCrossReferenceResp { - return &TGetCrossReferenceResp{} + return &TGetCrossReferenceResp{} } var TGetCrossReferenceResp_Status_DEFAULT *TStatus + func (p *TGetCrossReferenceResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetCrossReferenceResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetCrossReferenceResp_Status_DEFAULT + } + return p.Status } + var TGetCrossReferenceResp_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetCrossReferenceResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetCrossReferenceResp_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetCrossReferenceResp_OperationHandle_DEFAULT + } + return p.OperationHandle } + var TGetCrossReferenceResp_DirectResults_DEFAULT *TSparkDirectResults + func (p *TGetCrossReferenceResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetCrossReferenceResp_DirectResults_DEFAULT - } -return p.DirectResults + if !p.IsSetDirectResults() { + return TGetCrossReferenceResp_DirectResults_DEFAULT + } + return p.DirectResults } func (p *TGetCrossReferenceResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetCrossReferenceResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetCrossReferenceResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetCrossReferenceResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TGetCrossReferenceResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetCrossReferenceResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetCrossReferenceResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TGetCrossReferenceResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetCrossReferenceResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetCrossReferenceResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetCrossReferenceResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetCrossReferenceResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetCrossReferenceResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetCrossReferenceResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TGetCrossReferenceResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) + } + } + return err } func (p *TGetCrossReferenceResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) + } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) + } + } + return err } func (p *TGetCrossReferenceResp) Equals(other *TGetCrossReferenceResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if !p.DirectResults.Equals(other.DirectResults) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + if !p.DirectResults.Equals(other.DirectResults) { + return false + } + return true } func (p *TGetCrossReferenceResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetCrossReferenceResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetCrossReferenceResp(%+v)", *p) } func (p *TGetCrossReferenceResp) Validate() error { - return nil + return nil } + // Attributes: -// - OperationHandle -// - GetProgressUpdate +// - OperationHandle +// - GetProgressUpdate type TGetOperationStatusReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` - GetProgressUpdate *bool `thrift:"getProgressUpdate,2" db:"getProgressUpdate" json:"getProgressUpdate,omitempty"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + GetProgressUpdate *bool `thrift:"getProgressUpdate,2" db:"getProgressUpdate" json:"getProgressUpdate,omitempty"` } func NewTGetOperationStatusReq() *TGetOperationStatusReq { - return &TGetOperationStatusReq{} + return &TGetOperationStatusReq{} } var TGetOperationStatusReq_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetOperationStatusReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetOperationStatusReq_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetOperationStatusReq_OperationHandle_DEFAULT + } + return p.OperationHandle } + var TGetOperationStatusReq_GetProgressUpdate_DEFAULT bool + func (p *TGetOperationStatusReq) GetGetProgressUpdate() bool { - if !p.IsSetGetProgressUpdate() { - return TGetOperationStatusReq_GetProgressUpdate_DEFAULT - } -return *p.GetProgressUpdate + if !p.IsSetGetProgressUpdate() { + return TGetOperationStatusReq_GetProgressUpdate_DEFAULT + } + return *p.GetProgressUpdate } func (p *TGetOperationStatusReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetOperationStatusReq) IsSetGetProgressUpdate() bool { - return p.GetProgressUpdate != nil + return p.GetProgressUpdate != nil } func (p *TGetOperationStatusReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); - } - return nil -} - -func (p *TGetOperationStatusReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetOperationStatusReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.GetProgressUpdate = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperationHandle bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperationHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")) + } + return nil +} + +func (p *TGetOperationStatusReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetOperationStatusReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.GetProgressUpdate = &v + } + return nil } func (p *TGetOperationStatusReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetOperationStatusReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetOperationStatusReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetOperationStatusReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) + } + return err } func (p *TGetOperationStatusReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetProgressUpdate() { - if err := oprot.WriteFieldBegin(ctx, "getProgressUpdate", thrift.BOOL, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:getProgressUpdate: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.GetProgressUpdate)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.getProgressUpdate (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:getProgressUpdate: ", p), err) } - } - return err + if p.IsSetGetProgressUpdate() { + if err := oprot.WriteFieldBegin(ctx, "getProgressUpdate", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:getProgressUpdate: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.GetProgressUpdate)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.getProgressUpdate (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:getProgressUpdate: ", p), err) + } + } + return err } func (p *TGetOperationStatusReq) Equals(other *TGetOperationStatusReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if p.GetProgressUpdate != other.GetProgressUpdate { - if p.GetProgressUpdate == nil || other.GetProgressUpdate == nil { - return false - } - if (*p.GetProgressUpdate) != (*other.GetProgressUpdate) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + if p.GetProgressUpdate != other.GetProgressUpdate { + if p.GetProgressUpdate == nil || other.GetProgressUpdate == nil { + return false + } + if (*p.GetProgressUpdate) != (*other.GetProgressUpdate) { + return false + } + } + return true } func (p *TGetOperationStatusReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetOperationStatusReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetOperationStatusReq(%+v)", *p) } func (p *TGetOperationStatusReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - OperationState -// - SqlState -// - ErrorCode -// - ErrorMessage -// - TaskStatus -// - OperationStarted -// - OperationCompleted -// - HasResultSet -// - ProgressUpdateResponse -// - NumModifiedRows -// - DisplayMessage -// - DiagnosticInfo -// - ErrorDetailsJson +// - Status +// - OperationState +// - SqlState +// - ErrorCode +// - ErrorMessage +// - TaskStatus +// - OperationStarted +// - OperationCompleted +// - HasResultSet +// - ProgressUpdateResponse +// - NumModifiedRows +// - DisplayMessage +// - DiagnosticInfo +// - ErrorDetailsJson type TGetOperationStatusResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationState *TOperationState `thrift:"operationState,2" db:"operationState" json:"operationState,omitempty"` - SqlState *string `thrift:"sqlState,3" db:"sqlState" json:"sqlState,omitempty"` - ErrorCode *int32 `thrift:"errorCode,4" db:"errorCode" json:"errorCode,omitempty"` - ErrorMessage *string `thrift:"errorMessage,5" db:"errorMessage" json:"errorMessage,omitempty"` - TaskStatus *string `thrift:"taskStatus,6" db:"taskStatus" json:"taskStatus,omitempty"` - OperationStarted *int64 `thrift:"operationStarted,7" db:"operationStarted" json:"operationStarted,omitempty"` - OperationCompleted *int64 `thrift:"operationCompleted,8" db:"operationCompleted" json:"operationCompleted,omitempty"` - HasResultSet *bool `thrift:"hasResultSet,9" db:"hasResultSet" json:"hasResultSet,omitempty"` - ProgressUpdateResponse *TProgressUpdateResp `thrift:"progressUpdateResponse,10" db:"progressUpdateResponse" json:"progressUpdateResponse,omitempty"` - NumModifiedRows *int64 `thrift:"numModifiedRows,11" db:"numModifiedRows" json:"numModifiedRows,omitempty"` - // unused fields # 12 to 1280 - DisplayMessage *string `thrift:"displayMessage,1281" db:"displayMessage" json:"displayMessage,omitempty"` - DiagnosticInfo *string `thrift:"diagnosticInfo,1282" db:"diagnosticInfo" json:"diagnosticInfo,omitempty"` - ErrorDetailsJson *string `thrift:"errorDetailsJson,1283" db:"errorDetailsJson" json:"errorDetailsJson,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationState *TOperationState `thrift:"operationState,2" db:"operationState" json:"operationState,omitempty"` + SqlState *string `thrift:"sqlState,3" db:"sqlState" json:"sqlState,omitempty"` + ErrorCode *int32 `thrift:"errorCode,4" db:"errorCode" json:"errorCode,omitempty"` + ErrorMessage *string `thrift:"errorMessage,5" db:"errorMessage" json:"errorMessage,omitempty"` + TaskStatus *string `thrift:"taskStatus,6" db:"taskStatus" json:"taskStatus,omitempty"` + OperationStarted *int64 `thrift:"operationStarted,7" db:"operationStarted" json:"operationStarted,omitempty"` + OperationCompleted *int64 `thrift:"operationCompleted,8" db:"operationCompleted" json:"operationCompleted,omitempty"` + HasResultSet *bool `thrift:"hasResultSet,9" db:"hasResultSet" json:"hasResultSet,omitempty"` + ProgressUpdateResponse *TProgressUpdateResp `thrift:"progressUpdateResponse,10" db:"progressUpdateResponse" json:"progressUpdateResponse,omitempty"` + NumModifiedRows *int64 `thrift:"numModifiedRows,11" db:"numModifiedRows" json:"numModifiedRows,omitempty"` + // unused fields # 12 to 1280 + DisplayMessage *string `thrift:"displayMessage,1281" db:"displayMessage" json:"displayMessage,omitempty"` + DiagnosticInfo *string `thrift:"diagnosticInfo,1282" db:"diagnosticInfo" json:"diagnosticInfo,omitempty"` + ErrorDetailsJson *string `thrift:"errorDetailsJson,1283" db:"errorDetailsJson" json:"errorDetailsJson,omitempty"` } func NewTGetOperationStatusResp() *TGetOperationStatusResp { - return &TGetOperationStatusResp{} + return &TGetOperationStatusResp{} } var TGetOperationStatusResp_Status_DEFAULT *TStatus + func (p *TGetOperationStatusResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetOperationStatusResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetOperationStatusResp_Status_DEFAULT + } + return p.Status } + var TGetOperationStatusResp_OperationState_DEFAULT TOperationState + func (p *TGetOperationStatusResp) GetOperationState() TOperationState { - if !p.IsSetOperationState() { - return TGetOperationStatusResp_OperationState_DEFAULT - } -return *p.OperationState + if !p.IsSetOperationState() { + return TGetOperationStatusResp_OperationState_DEFAULT + } + return *p.OperationState } + var TGetOperationStatusResp_SqlState_DEFAULT string + func (p *TGetOperationStatusResp) GetSqlState() string { - if !p.IsSetSqlState() { - return TGetOperationStatusResp_SqlState_DEFAULT - } -return *p.SqlState + if !p.IsSetSqlState() { + return TGetOperationStatusResp_SqlState_DEFAULT + } + return *p.SqlState } + var TGetOperationStatusResp_ErrorCode_DEFAULT int32 + func (p *TGetOperationStatusResp) GetErrorCode() int32 { - if !p.IsSetErrorCode() { - return TGetOperationStatusResp_ErrorCode_DEFAULT - } -return *p.ErrorCode + if !p.IsSetErrorCode() { + return TGetOperationStatusResp_ErrorCode_DEFAULT + } + return *p.ErrorCode } + var TGetOperationStatusResp_ErrorMessage_DEFAULT string + func (p *TGetOperationStatusResp) GetErrorMessage() string { - if !p.IsSetErrorMessage() { - return TGetOperationStatusResp_ErrorMessage_DEFAULT - } -return *p.ErrorMessage + if !p.IsSetErrorMessage() { + return TGetOperationStatusResp_ErrorMessage_DEFAULT + } + return *p.ErrorMessage } + var TGetOperationStatusResp_TaskStatus_DEFAULT string + func (p *TGetOperationStatusResp) GetTaskStatus() string { - if !p.IsSetTaskStatus() { - return TGetOperationStatusResp_TaskStatus_DEFAULT - } -return *p.TaskStatus + if !p.IsSetTaskStatus() { + return TGetOperationStatusResp_TaskStatus_DEFAULT + } + return *p.TaskStatus } + var TGetOperationStatusResp_OperationStarted_DEFAULT int64 + func (p *TGetOperationStatusResp) GetOperationStarted() int64 { - if !p.IsSetOperationStarted() { - return TGetOperationStatusResp_OperationStarted_DEFAULT - } -return *p.OperationStarted + if !p.IsSetOperationStarted() { + return TGetOperationStatusResp_OperationStarted_DEFAULT + } + return *p.OperationStarted } + var TGetOperationStatusResp_OperationCompleted_DEFAULT int64 + func (p *TGetOperationStatusResp) GetOperationCompleted() int64 { - if !p.IsSetOperationCompleted() { - return TGetOperationStatusResp_OperationCompleted_DEFAULT - } -return *p.OperationCompleted + if !p.IsSetOperationCompleted() { + return TGetOperationStatusResp_OperationCompleted_DEFAULT + } + return *p.OperationCompleted } + var TGetOperationStatusResp_HasResultSet_DEFAULT bool + func (p *TGetOperationStatusResp) GetHasResultSet() bool { - if !p.IsSetHasResultSet() { - return TGetOperationStatusResp_HasResultSet_DEFAULT - } -return *p.HasResultSet + if !p.IsSetHasResultSet() { + return TGetOperationStatusResp_HasResultSet_DEFAULT + } + return *p.HasResultSet } + var TGetOperationStatusResp_ProgressUpdateResponse_DEFAULT *TProgressUpdateResp + func (p *TGetOperationStatusResp) GetProgressUpdateResponse() *TProgressUpdateResp { - if !p.IsSetProgressUpdateResponse() { - return TGetOperationStatusResp_ProgressUpdateResponse_DEFAULT - } -return p.ProgressUpdateResponse + if !p.IsSetProgressUpdateResponse() { + return TGetOperationStatusResp_ProgressUpdateResponse_DEFAULT + } + return p.ProgressUpdateResponse } + var TGetOperationStatusResp_NumModifiedRows_DEFAULT int64 + func (p *TGetOperationStatusResp) GetNumModifiedRows() int64 { - if !p.IsSetNumModifiedRows() { - return TGetOperationStatusResp_NumModifiedRows_DEFAULT - } -return *p.NumModifiedRows + if !p.IsSetNumModifiedRows() { + return TGetOperationStatusResp_NumModifiedRows_DEFAULT + } + return *p.NumModifiedRows } + var TGetOperationStatusResp_DisplayMessage_DEFAULT string + func (p *TGetOperationStatusResp) GetDisplayMessage() string { - if !p.IsSetDisplayMessage() { - return TGetOperationStatusResp_DisplayMessage_DEFAULT - } -return *p.DisplayMessage + if !p.IsSetDisplayMessage() { + return TGetOperationStatusResp_DisplayMessage_DEFAULT + } + return *p.DisplayMessage } + var TGetOperationStatusResp_DiagnosticInfo_DEFAULT string + func (p *TGetOperationStatusResp) GetDiagnosticInfo() string { - if !p.IsSetDiagnosticInfo() { - return TGetOperationStatusResp_DiagnosticInfo_DEFAULT - } -return *p.DiagnosticInfo + if !p.IsSetDiagnosticInfo() { + return TGetOperationStatusResp_DiagnosticInfo_DEFAULT + } + return *p.DiagnosticInfo } + var TGetOperationStatusResp_ErrorDetailsJson_DEFAULT string + func (p *TGetOperationStatusResp) GetErrorDetailsJson() string { - if !p.IsSetErrorDetailsJson() { - return TGetOperationStatusResp_ErrorDetailsJson_DEFAULT - } -return *p.ErrorDetailsJson + if !p.IsSetErrorDetailsJson() { + return TGetOperationStatusResp_ErrorDetailsJson_DEFAULT + } + return *p.ErrorDetailsJson } func (p *TGetOperationStatusResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetOperationStatusResp) IsSetOperationState() bool { - return p.OperationState != nil + return p.OperationState != nil } func (p *TGetOperationStatusResp) IsSetSqlState() bool { - return p.SqlState != nil + return p.SqlState != nil } func (p *TGetOperationStatusResp) IsSetErrorCode() bool { - return p.ErrorCode != nil + return p.ErrorCode != nil } func (p *TGetOperationStatusResp) IsSetErrorMessage() bool { - return p.ErrorMessage != nil + return p.ErrorMessage != nil } func (p *TGetOperationStatusResp) IsSetTaskStatus() bool { - return p.TaskStatus != nil + return p.TaskStatus != nil } func (p *TGetOperationStatusResp) IsSetOperationStarted() bool { - return p.OperationStarted != nil + return p.OperationStarted != nil } func (p *TGetOperationStatusResp) IsSetOperationCompleted() bool { - return p.OperationCompleted != nil + return p.OperationCompleted != nil } func (p *TGetOperationStatusResp) IsSetHasResultSet() bool { - return p.HasResultSet != nil + return p.HasResultSet != nil } func (p *TGetOperationStatusResp) IsSetProgressUpdateResponse() bool { - return p.ProgressUpdateResponse != nil + return p.ProgressUpdateResponse != nil } func (p *TGetOperationStatusResp) IsSetNumModifiedRows() bool { - return p.NumModifiedRows != nil + return p.NumModifiedRows != nil } func (p *TGetOperationStatusResp) IsSetDisplayMessage() bool { - return p.DisplayMessage != nil + return p.DisplayMessage != nil } func (p *TGetOperationStatusResp) IsSetDiagnosticInfo() bool { - return p.DiagnosticInfo != nil + return p.DiagnosticInfo != nil } func (p *TGetOperationStatusResp) IsSetErrorDetailsJson() bool { - return p.ErrorDetailsJson != nil + return p.ErrorDetailsJson != nil } func (p *TGetOperationStatusResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I32 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRING { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.I64 { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 8: - if fieldTypeId == thrift.I64 { - if err := p.ReadField8(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 9: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField9(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 10: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField10(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 11: - if fieldTypeId == thrift.I64 { - if err := p.ReadField11(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1283: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1283(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TOperationState(v) - p.OperationState = &temp -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.SqlState = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.ErrorCode = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.ErrorMessage = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) -} else { - p.TaskStatus = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 7: ", err) -} else { - p.OperationStarted = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 8: ", err) -} else { - p.OperationCompleted = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 9: ", err) -} else { - p.HasResultSet = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { - p.ProgressUpdateResponse = &TProgressUpdateResp{} - if err := p.ProgressUpdateResponse.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProgressUpdateResponse), err) - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField11(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 11: ", err) -} else { - p.NumModifiedRows = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1281: ", err) -} else { - p.DisplayMessage = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.DiagnosticInfo = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1283: ", err) -} else { - p.ErrorDetailsJson = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I64 { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.I64 { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField9(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField10(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.I64 { + if err := p.ReadField11(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1283: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1283(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TOperationState(v) + p.OperationState = &temp + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.SqlState = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.ErrorCode = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.ErrorMessage = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.TaskStatus = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) + } else { + p.OperationStarted = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) + } else { + p.OperationCompleted = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 9: ", err) + } else { + p.HasResultSet = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { + p.ProgressUpdateResponse = &TProgressUpdateResp{} + if err := p.ProgressUpdateResponse.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProgressUpdateResponse), err) + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField11(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 11: ", err) + } else { + p.NumModifiedRows = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1281: ", err) + } else { + p.DisplayMessage = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.DiagnosticInfo = &v + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1283: ", err) + } else { + p.ErrorDetailsJson = &v + } + return nil } func (p *TGetOperationStatusResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetOperationStatusResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - if err := p.writeField7(ctx, oprot); err != nil { return err } - if err := p.writeField8(ctx, oprot); err != nil { return err } - if err := p.writeField9(ctx, oprot); err != nil { return err } - if err := p.writeField10(ctx, oprot); err != nil { return err } - if err := p.writeField11(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - if err := p.writeField1283(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetOperationStatusResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField6(ctx, oprot); err != nil { + return err + } + if err := p.writeField7(ctx, oprot); err != nil { + return err + } + if err := p.writeField8(ctx, oprot); err != nil { + return err + } + if err := p.writeField9(ctx, oprot); err != nil { + return err + } + if err := p.writeField10(ctx, oprot); err != nil { + return err + } + if err := p.writeField11(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + if err := p.writeField1283(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetOperationStatusResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TGetOperationStatusResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationState() { - if err := oprot.WriteFieldBegin(ctx, "operationState", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationState: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.OperationState)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationState (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationState: ", p), err) } - } - return err + if p.IsSetOperationState() { + if err := oprot.WriteFieldBegin(ctx, "operationState", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationState: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.OperationState)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationState (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationState: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSqlState() { - if err := oprot.WriteFieldBegin(ctx, "sqlState", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.SqlState)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) } - } - return err + if p.IsSetSqlState() { + if err := oprot.WriteFieldBegin(ctx, "sqlState", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.SqlState)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorCode() { - if err := oprot.WriteFieldBegin(ctx, "errorCode", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.ErrorCode)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) } - } - return err + if p.IsSetErrorCode() { + if err := oprot.WriteFieldBegin(ctx, "errorCode", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorMessage() { - if err := oprot.WriteFieldBegin(ctx, "errorMessage", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ErrorMessage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) } - } - return err + if p.IsSetErrorMessage() { + if err := oprot.WriteFieldBegin(ctx, "errorMessage", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.ErrorMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTaskStatus() { - if err := oprot.WriteFieldBegin(ctx, "taskStatus", thrift.STRING, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:taskStatus: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.TaskStatus)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.taskStatus (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:taskStatus: ", p), err) } - } - return err + if p.IsSetTaskStatus() { + if err := oprot.WriteFieldBegin(ctx, "taskStatus", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:taskStatus: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.TaskStatus)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.taskStatus (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:taskStatus: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationStarted() { - if err := oprot.WriteFieldBegin(ctx, "operationStarted", thrift.I64, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:operationStarted: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.OperationStarted)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationStarted (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:operationStarted: ", p), err) } - } - return err + if p.IsSetOperationStarted() { + if err := oprot.WriteFieldBegin(ctx, "operationStarted", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:operationStarted: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.OperationStarted)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationStarted (7) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:operationStarted: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationCompleted() { - if err := oprot.WriteFieldBegin(ctx, "operationCompleted", thrift.I64, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:operationCompleted: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.OperationCompleted)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationCompleted (8) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:operationCompleted: ", p), err) } - } - return err + if p.IsSetOperationCompleted() { + if err := oprot.WriteFieldBegin(ctx, "operationCompleted", thrift.I64, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:operationCompleted: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.OperationCompleted)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationCompleted (8) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:operationCompleted: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetHasResultSet() { - if err := oprot.WriteFieldBegin(ctx, "hasResultSet", thrift.BOOL, 9); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:hasResultSet: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.HasResultSet)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (9) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 9:hasResultSet: ", p), err) } - } - return err + if p.IsSetHasResultSet() { + if err := oprot.WriteFieldBegin(ctx, "hasResultSet", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:hasResultSet: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.HasResultSet)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (9) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:hasResultSet: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetProgressUpdateResponse() { - if err := oprot.WriteFieldBegin(ctx, "progressUpdateResponse", thrift.STRUCT, 10); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:progressUpdateResponse: ", p), err) } - if err := p.ProgressUpdateResponse.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProgressUpdateResponse), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 10:progressUpdateResponse: ", p), err) } - } - return err + if p.IsSetProgressUpdateResponse() { + if err := oprot.WriteFieldBegin(ctx, "progressUpdateResponse", thrift.STRUCT, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:progressUpdateResponse: ", p), err) + } + if err := p.ProgressUpdateResponse.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProgressUpdateResponse), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:progressUpdateResponse: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) writeField11(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetNumModifiedRows() { - if err := oprot.WriteFieldBegin(ctx, "numModifiedRows", thrift.I64, 11); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:numModifiedRows: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.NumModifiedRows)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.numModifiedRows (11) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 11:numModifiedRows: ", p), err) } - } - return err + if p.IsSetNumModifiedRows() { + if err := oprot.WriteFieldBegin(ctx, "numModifiedRows", thrift.I64, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:numModifiedRows: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.NumModifiedRows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.numModifiedRows (11) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:numModifiedRows: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDisplayMessage() { - if err := oprot.WriteFieldBegin(ctx, "displayMessage", thrift.STRING, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:displayMessage: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.DisplayMessage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.displayMessage (1281) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:displayMessage: ", p), err) } - } - return err + if p.IsSetDisplayMessage() { + if err := oprot.WriteFieldBegin(ctx, "displayMessage", thrift.STRING, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:displayMessage: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.DisplayMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.displayMessage (1281) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:displayMessage: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDiagnosticInfo() { - if err := oprot.WriteFieldBegin(ctx, "diagnosticInfo", thrift.STRING, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:diagnosticInfo: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.DiagnosticInfo)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.diagnosticInfo (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:diagnosticInfo: ", p), err) } - } - return err + if p.IsSetDiagnosticInfo() { + if err := oprot.WriteFieldBegin(ctx, "diagnosticInfo", thrift.STRING, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:diagnosticInfo: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.DiagnosticInfo)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.diagnosticInfo (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:diagnosticInfo: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) writeField1283(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorDetailsJson() { - if err := oprot.WriteFieldBegin(ctx, "errorDetailsJson", thrift.STRING, 1283); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:errorDetailsJson: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.ErrorDetailsJson)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorDetailsJson (1283) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:errorDetailsJson: ", p), err) } - } - return err + if p.IsSetErrorDetailsJson() { + if err := oprot.WriteFieldBegin(ctx, "errorDetailsJson", thrift.STRING, 1283); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:errorDetailsJson: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.ErrorDetailsJson)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorDetailsJson (1283) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:errorDetailsJson: ", p), err) + } + } + return err } func (p *TGetOperationStatusResp) Equals(other *TGetOperationStatusResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if p.OperationState != other.OperationState { - if p.OperationState == nil || other.OperationState == nil { - return false - } - if (*p.OperationState) != (*other.OperationState) { return false } - } - if p.SqlState != other.SqlState { - if p.SqlState == nil || other.SqlState == nil { - return false - } - if (*p.SqlState) != (*other.SqlState) { return false } - } - if p.ErrorCode != other.ErrorCode { - if p.ErrorCode == nil || other.ErrorCode == nil { - return false - } - if (*p.ErrorCode) != (*other.ErrorCode) { return false } - } - if p.ErrorMessage != other.ErrorMessage { - if p.ErrorMessage == nil || other.ErrorMessage == nil { - return false - } - if (*p.ErrorMessage) != (*other.ErrorMessage) { return false } - } - if p.TaskStatus != other.TaskStatus { - if p.TaskStatus == nil || other.TaskStatus == nil { - return false - } - if (*p.TaskStatus) != (*other.TaskStatus) { return false } - } - if p.OperationStarted != other.OperationStarted { - if p.OperationStarted == nil || other.OperationStarted == nil { - return false - } - if (*p.OperationStarted) != (*other.OperationStarted) { return false } - } - if p.OperationCompleted != other.OperationCompleted { - if p.OperationCompleted == nil || other.OperationCompleted == nil { - return false - } - if (*p.OperationCompleted) != (*other.OperationCompleted) { return false } - } - if p.HasResultSet != other.HasResultSet { - if p.HasResultSet == nil || other.HasResultSet == nil { - return false - } - if (*p.HasResultSet) != (*other.HasResultSet) { return false } - } - if !p.ProgressUpdateResponse.Equals(other.ProgressUpdateResponse) { return false } - if p.NumModifiedRows != other.NumModifiedRows { - if p.NumModifiedRows == nil || other.NumModifiedRows == nil { - return false - } - if (*p.NumModifiedRows) != (*other.NumModifiedRows) { return false } - } - if p.DisplayMessage != other.DisplayMessage { - if p.DisplayMessage == nil || other.DisplayMessage == nil { - return false - } - if (*p.DisplayMessage) != (*other.DisplayMessage) { return false } - } - if p.DiagnosticInfo != other.DiagnosticInfo { - if p.DiagnosticInfo == nil || other.DiagnosticInfo == nil { - return false - } - if (*p.DiagnosticInfo) != (*other.DiagnosticInfo) { return false } - } - if p.ErrorDetailsJson != other.ErrorDetailsJson { - if p.ErrorDetailsJson == nil || other.ErrorDetailsJson == nil { - return false - } - if (*p.ErrorDetailsJson) != (*other.ErrorDetailsJson) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if p.OperationState != other.OperationState { + if p.OperationState == nil || other.OperationState == nil { + return false + } + if (*p.OperationState) != (*other.OperationState) { + return false + } + } + if p.SqlState != other.SqlState { + if p.SqlState == nil || other.SqlState == nil { + return false + } + if (*p.SqlState) != (*other.SqlState) { + return false + } + } + if p.ErrorCode != other.ErrorCode { + if p.ErrorCode == nil || other.ErrorCode == nil { + return false + } + if (*p.ErrorCode) != (*other.ErrorCode) { + return false + } + } + if p.ErrorMessage != other.ErrorMessage { + if p.ErrorMessage == nil || other.ErrorMessage == nil { + return false + } + if (*p.ErrorMessage) != (*other.ErrorMessage) { + return false + } + } + if p.TaskStatus != other.TaskStatus { + if p.TaskStatus == nil || other.TaskStatus == nil { + return false + } + if (*p.TaskStatus) != (*other.TaskStatus) { + return false + } + } + if p.OperationStarted != other.OperationStarted { + if p.OperationStarted == nil || other.OperationStarted == nil { + return false + } + if (*p.OperationStarted) != (*other.OperationStarted) { + return false + } + } + if p.OperationCompleted != other.OperationCompleted { + if p.OperationCompleted == nil || other.OperationCompleted == nil { + return false + } + if (*p.OperationCompleted) != (*other.OperationCompleted) { + return false + } + } + if p.HasResultSet != other.HasResultSet { + if p.HasResultSet == nil || other.HasResultSet == nil { + return false + } + if (*p.HasResultSet) != (*other.HasResultSet) { + return false + } + } + if !p.ProgressUpdateResponse.Equals(other.ProgressUpdateResponse) { + return false + } + if p.NumModifiedRows != other.NumModifiedRows { + if p.NumModifiedRows == nil || other.NumModifiedRows == nil { + return false + } + if (*p.NumModifiedRows) != (*other.NumModifiedRows) { + return false + } + } + if p.DisplayMessage != other.DisplayMessage { + if p.DisplayMessage == nil || other.DisplayMessage == nil { + return false + } + if (*p.DisplayMessage) != (*other.DisplayMessage) { + return false + } + } + if p.DiagnosticInfo != other.DiagnosticInfo { + if p.DiagnosticInfo == nil || other.DiagnosticInfo == nil { + return false + } + if (*p.DiagnosticInfo) != (*other.DiagnosticInfo) { + return false + } + } + if p.ErrorDetailsJson != other.ErrorDetailsJson { + if p.ErrorDetailsJson == nil || other.ErrorDetailsJson == nil { + return false + } + if (*p.ErrorDetailsJson) != (*other.ErrorDetailsJson) { + return false + } + } + return true } func (p *TGetOperationStatusResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetOperationStatusResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetOperationStatusResp(%+v)", *p) } func (p *TGetOperationStatusResp) Validate() error { - return nil + return nil } + // Attributes: -// - OperationHandle +// - OperationHandle type TCancelOperationReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` } func NewTCancelOperationReq() *TCancelOperationReq { - return &TCancelOperationReq{} + return &TCancelOperationReq{} } var TCancelOperationReq_OperationHandle_DEFAULT *TOperationHandle + func (p *TCancelOperationReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TCancelOperationReq_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TCancelOperationReq_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TCancelOperationReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TCancelOperationReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); - } - return nil -} - -func (p *TCancelOperationReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperationHandle bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperationHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")) + } + return nil +} + +func (p *TCancelOperationReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil } func (p *TCancelOperationReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCancelOperationReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TCancelOperationReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCancelOperationReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) + } + return err } func (p *TCancelOperationReq) Equals(other *TCancelOperationReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + return true } func (p *TCancelOperationReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCancelOperationReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCancelOperationReq(%+v)", *p) } func (p *TCancelOperationReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status +// - Status type TCancelOperationResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTCancelOperationResp() *TCancelOperationResp { - return &TCancelOperationResp{} + return &TCancelOperationResp{} } var TCancelOperationResp_Status_DEFAULT *TStatus + func (p *TCancelOperationResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCancelOperationResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TCancelOperationResp_Status_DEFAULT + } + return p.Status } func (p *TCancelOperationResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TCancelOperationResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TCancelOperationResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TCancelOperationResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil } func (p *TCancelOperationResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCancelOperationResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TCancelOperationResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCancelOperationResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TCancelOperationResp) Equals(other *TCancelOperationResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + return true } func (p *TCancelOperationResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCancelOperationResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCancelOperationResp(%+v)", *p) } func (p *TCancelOperationResp) Validate() error { - return nil + return nil } + // Attributes: -// - OperationHandle +// - OperationHandle type TCloseOperationReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` } func NewTCloseOperationReq() *TCloseOperationReq { - return &TCloseOperationReq{} + return &TCloseOperationReq{} } var TCloseOperationReq_OperationHandle_DEFAULT *TOperationHandle + func (p *TCloseOperationReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TCloseOperationReq_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TCloseOperationReq_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TCloseOperationReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TCloseOperationReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); - } - return nil -} - -func (p *TCloseOperationReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperationHandle bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperationHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")) + } + return nil +} + +func (p *TCloseOperationReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil } func (p *TCloseOperationReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCloseOperationReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TCloseOperationReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCloseOperationReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) + } + return err } func (p *TCloseOperationReq) Equals(other *TCloseOperationReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + return true } func (p *TCloseOperationReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCloseOperationReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCloseOperationReq(%+v)", *p) } func (p *TCloseOperationReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status +// - Status type TCloseOperationResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTCloseOperationResp() *TCloseOperationResp { - return &TCloseOperationResp{} + return &TCloseOperationResp{} } var TCloseOperationResp_Status_DEFAULT *TStatus + func (p *TCloseOperationResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCloseOperationResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TCloseOperationResp_Status_DEFAULT + } + return p.Status } func (p *TCloseOperationResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TCloseOperationResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TCloseOperationResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TCloseOperationResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil } func (p *TCloseOperationResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCloseOperationResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TCloseOperationResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCloseOperationResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TCloseOperationResp) Equals(other *TCloseOperationResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + return true } func (p *TCloseOperationResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCloseOperationResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCloseOperationResp(%+v)", *p) } func (p *TCloseOperationResp) Validate() error { - return nil + return nil } + // Attributes: -// - OperationHandle +// - OperationHandle type TGetResultSetMetadataReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` } func NewTGetResultSetMetadataReq() *TGetResultSetMetadataReq { - return &TGetResultSetMetadataReq{} + return &TGetResultSetMetadataReq{} } var TGetResultSetMetadataReq_OperationHandle_DEFAULT *TOperationHandle + func (p *TGetResultSetMetadataReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetResultSetMetadataReq_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetResultSetMetadataReq_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TGetResultSetMetadataReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetResultSetMetadataReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); - } - return nil -} - -func (p *TGetResultSetMetadataReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperationHandle bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperationHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")) + } + return nil +} + +func (p *TGetResultSetMetadataReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil } func (p *TGetResultSetMetadataReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetResultSetMetadataReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetResultSetMetadataReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetResultSetMetadataReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) + } + return err } func (p *TGetResultSetMetadataReq) Equals(other *TGetResultSetMetadataReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + return true } func (p *TGetResultSetMetadataReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetResultSetMetadataReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetResultSetMetadataReq(%+v)", *p) } func (p *TGetResultSetMetadataReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - Schema -// - ResultFormat -// - Lz4Compressed -// - ArrowSchema -// - CacheLookupResult_ -// - UncompressedBytes -// - CompressedBytes -// - IsStagingOperation +// - Status +// - Schema +// - ResultFormat +// - Lz4Compressed +// - ArrowSchema +// - CacheLookupResult_ +// - UncompressedBytes +// - CompressedBytes +// - IsStagingOperation type TGetResultSetMetadataResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - Schema *TTableSchema `thrift:"schema,2" db:"schema" json:"schema,omitempty"` - // unused fields # 3 to 1280 - ResultFormat *TSparkRowSetType `thrift:"resultFormat,1281" db:"resultFormat" json:"resultFormat,omitempty"` - Lz4Compressed *bool `thrift:"lz4Compressed,1282" db:"lz4Compressed" json:"lz4Compressed,omitempty"` - ArrowSchema []byte `thrift:"arrowSchema,1283" db:"arrowSchema" json:"arrowSchema,omitempty"` - CacheLookupResult_ *TCacheLookupResult_ `thrift:"cacheLookupResult,1284" db:"cacheLookupResult" json:"cacheLookupResult,omitempty"` - UncompressedBytes *int64 `thrift:"uncompressedBytes,1285" db:"uncompressedBytes" json:"uncompressedBytes,omitempty"` - CompressedBytes *int64 `thrift:"compressedBytes,1286" db:"compressedBytes" json:"compressedBytes,omitempty"` - IsStagingOperation *bool `thrift:"isStagingOperation,1287" db:"isStagingOperation" json:"isStagingOperation,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Schema *TTableSchema `thrift:"schema,2" db:"schema" json:"schema,omitempty"` + // unused fields # 3 to 1280 + ResultFormat *TSparkRowSetType `thrift:"resultFormat,1281" db:"resultFormat" json:"resultFormat,omitempty"` + Lz4Compressed *bool `thrift:"lz4Compressed,1282" db:"lz4Compressed" json:"lz4Compressed,omitempty"` + ArrowSchema []byte `thrift:"arrowSchema,1283" db:"arrowSchema" json:"arrowSchema,omitempty"` + CacheLookupResult_ *TCacheLookupResult_ `thrift:"cacheLookupResult,1284" db:"cacheLookupResult" json:"cacheLookupResult,omitempty"` + UncompressedBytes *int64 `thrift:"uncompressedBytes,1285" db:"uncompressedBytes" json:"uncompressedBytes,omitempty"` + CompressedBytes *int64 `thrift:"compressedBytes,1286" db:"compressedBytes" json:"compressedBytes,omitempty"` + IsStagingOperation *bool `thrift:"isStagingOperation,1287" db:"isStagingOperation" json:"isStagingOperation,omitempty"` } func NewTGetResultSetMetadataResp() *TGetResultSetMetadataResp { - return &TGetResultSetMetadataResp{} + return &TGetResultSetMetadataResp{} } var TGetResultSetMetadataResp_Status_DEFAULT *TStatus + func (p *TGetResultSetMetadataResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetResultSetMetadataResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetResultSetMetadataResp_Status_DEFAULT + } + return p.Status } + var TGetResultSetMetadataResp_Schema_DEFAULT *TTableSchema + func (p *TGetResultSetMetadataResp) GetSchema() *TTableSchema { - if !p.IsSetSchema() { - return TGetResultSetMetadataResp_Schema_DEFAULT - } -return p.Schema + if !p.IsSetSchema() { + return TGetResultSetMetadataResp_Schema_DEFAULT + } + return p.Schema } + var TGetResultSetMetadataResp_ResultFormat_DEFAULT TSparkRowSetType + func (p *TGetResultSetMetadataResp) GetResultFormat() TSparkRowSetType { - if !p.IsSetResultFormat() { - return TGetResultSetMetadataResp_ResultFormat_DEFAULT - } -return *p.ResultFormat + if !p.IsSetResultFormat() { + return TGetResultSetMetadataResp_ResultFormat_DEFAULT + } + return *p.ResultFormat } + var TGetResultSetMetadataResp_Lz4Compressed_DEFAULT bool + func (p *TGetResultSetMetadataResp) GetLz4Compressed() bool { - if !p.IsSetLz4Compressed() { - return TGetResultSetMetadataResp_Lz4Compressed_DEFAULT - } -return *p.Lz4Compressed + if !p.IsSetLz4Compressed() { + return TGetResultSetMetadataResp_Lz4Compressed_DEFAULT + } + return *p.Lz4Compressed } + var TGetResultSetMetadataResp_ArrowSchema_DEFAULT []byte func (p *TGetResultSetMetadataResp) GetArrowSchema() []byte { - return p.ArrowSchema + return p.ArrowSchema } + var TGetResultSetMetadataResp_CacheLookupResult__DEFAULT TCacheLookupResult_ + func (p *TGetResultSetMetadataResp) GetCacheLookupResult_() TCacheLookupResult_ { - if !p.IsSetCacheLookupResult_() { - return TGetResultSetMetadataResp_CacheLookupResult__DEFAULT - } -return *p.CacheLookupResult_ + if !p.IsSetCacheLookupResult_() { + return TGetResultSetMetadataResp_CacheLookupResult__DEFAULT + } + return *p.CacheLookupResult_ } + var TGetResultSetMetadataResp_UncompressedBytes_DEFAULT int64 + func (p *TGetResultSetMetadataResp) GetUncompressedBytes() int64 { - if !p.IsSetUncompressedBytes() { - return TGetResultSetMetadataResp_UncompressedBytes_DEFAULT - } -return *p.UncompressedBytes + if !p.IsSetUncompressedBytes() { + return TGetResultSetMetadataResp_UncompressedBytes_DEFAULT + } + return *p.UncompressedBytes } + var TGetResultSetMetadataResp_CompressedBytes_DEFAULT int64 + func (p *TGetResultSetMetadataResp) GetCompressedBytes() int64 { - if !p.IsSetCompressedBytes() { - return TGetResultSetMetadataResp_CompressedBytes_DEFAULT - } -return *p.CompressedBytes + if !p.IsSetCompressedBytes() { + return TGetResultSetMetadataResp_CompressedBytes_DEFAULT + } + return *p.CompressedBytes } + var TGetResultSetMetadataResp_IsStagingOperation_DEFAULT bool + func (p *TGetResultSetMetadataResp) GetIsStagingOperation() bool { - if !p.IsSetIsStagingOperation() { - return TGetResultSetMetadataResp_IsStagingOperation_DEFAULT - } -return *p.IsStagingOperation + if !p.IsSetIsStagingOperation() { + return TGetResultSetMetadataResp_IsStagingOperation_DEFAULT + } + return *p.IsStagingOperation } func (p *TGetResultSetMetadataResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetResultSetMetadataResp) IsSetSchema() bool { - return p.Schema != nil + return p.Schema != nil } func (p *TGetResultSetMetadataResp) IsSetResultFormat() bool { - return p.ResultFormat != nil + return p.ResultFormat != nil } func (p *TGetResultSetMetadataResp) IsSetLz4Compressed() bool { - return p.Lz4Compressed != nil + return p.Lz4Compressed != nil } func (p *TGetResultSetMetadataResp) IsSetArrowSchema() bool { - return p.ArrowSchema != nil + return p.ArrowSchema != nil } func (p *TGetResultSetMetadataResp) IsSetCacheLookupResult_() bool { - return p.CacheLookupResult_ != nil + return p.CacheLookupResult_ != nil } func (p *TGetResultSetMetadataResp) IsSetUncompressedBytes() bool { - return p.UncompressedBytes != nil + return p.UncompressedBytes != nil } func (p *TGetResultSetMetadataResp) IsSetCompressedBytes() bool { - return p.CompressedBytes != nil + return p.CompressedBytes != nil } func (p *TGetResultSetMetadataResp) IsSetIsStagingOperation() bool { - return p.IsStagingOperation != nil + return p.IsStagingOperation != nil } func (p *TGetResultSetMetadataResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1283: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1283(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1284: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1284(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1285: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1285(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1286: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1286(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1287: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1287(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.Schema = &TTableSchema{} - if err := p.Schema.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) - } - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1281: ", err) -} else { - temp := TSparkRowSetType(v) - p.ResultFormat = &temp -} - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.Lz4Compressed = &v -} - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 1283: ", err) -} else { - p.ArrowSchema = v -} - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1284: ", err) -} else { - temp := TCacheLookupResult_(v) - p.CacheLookupResult_ = &temp -} - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1285: ", err) -} else { - p.UncompressedBytes = &v -} - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1286(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1286: ", err) -} else { - p.CompressedBytes = &v -} - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1287(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1287: ", err) -} else { - p.IsStagingOperation = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1283: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1283(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1284: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1284(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1285: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1285(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1286: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1286(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1287: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1287(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Schema = &TTableSchema{} + if err := p.Schema.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1281: ", err) + } else { + temp := TSparkRowSetType(v) + p.ResultFormat = &temp + } + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.Lz4Compressed = &v + } + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1283: ", err) + } else { + p.ArrowSchema = v + } + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1284: ", err) + } else { + temp := TCacheLookupResult_(v) + p.CacheLookupResult_ = &temp + } + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1285: ", err) + } else { + p.UncompressedBytes = &v + } + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1286(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1286: ", err) + } else { + p.CompressedBytes = &v + } + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1287(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1287: ", err) + } else { + p.IsStagingOperation = &v + } + return nil } func (p *TGetResultSetMetadataResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetResultSetMetadataResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - if err := p.writeField1283(ctx, oprot); err != nil { return err } - if err := p.writeField1284(ctx, oprot); err != nil { return err } - if err := p.writeField1285(ctx, oprot); err != nil { return err } - if err := p.writeField1286(ctx, oprot); err != nil { return err } - if err := p.writeField1287(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetResultSetMetadataResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + if err := p.writeField1283(ctx, oprot); err != nil { + return err + } + if err := p.writeField1284(ctx, oprot); err != nil { + return err + } + if err := p.writeField1285(ctx, oprot); err != nil { + return err + } + if err := p.writeField1286(ctx, oprot); err != nil { + return err + } + if err := p.writeField1287(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetResultSetMetadataResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TGetResultSetMetadataResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchema() { - if err := oprot.WriteFieldBegin(ctx, "schema", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema: ", p), err) } - if err := p.Schema.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema: ", p), err) } - } - return err + if p.IsSetSchema() { + if err := oprot.WriteFieldBegin(ctx, "schema", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema: ", p), err) + } + if err := p.Schema.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema: ", p), err) + } + } + return err } func (p *TGetResultSetMetadataResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResultFormat() { - if err := oprot.WriteFieldBegin(ctx, "resultFormat", thrift.I32, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:resultFormat: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.ResultFormat)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.resultFormat (1281) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:resultFormat: ", p), err) } - } - return err + if p.IsSetResultFormat() { + if err := oprot.WriteFieldBegin(ctx, "resultFormat", thrift.I32, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:resultFormat: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.ResultFormat)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.resultFormat (1281) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:resultFormat: ", p), err) + } + } + return err } func (p *TGetResultSetMetadataResp) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetLz4Compressed() { - if err := oprot.WriteFieldBegin(ctx, "lz4Compressed", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:lz4Compressed: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.Lz4Compressed)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.lz4Compressed (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:lz4Compressed: ", p), err) } - } - return err + if p.IsSetLz4Compressed() { + if err := oprot.WriteFieldBegin(ctx, "lz4Compressed", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:lz4Compressed: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.Lz4Compressed)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.lz4Compressed (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:lz4Compressed: ", p), err) + } + } + return err } func (p *TGetResultSetMetadataResp) writeField1283(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArrowSchema() { - if err := oprot.WriteFieldBegin(ctx, "arrowSchema", thrift.STRING, 1283); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:arrowSchema: ", p), err) } - if err := oprot.WriteBinary(ctx, p.ArrowSchema); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.arrowSchema (1283) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:arrowSchema: ", p), err) } - } - return err + if p.IsSetArrowSchema() { + if err := oprot.WriteFieldBegin(ctx, "arrowSchema", thrift.STRING, 1283); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:arrowSchema: ", p), err) + } + if err := oprot.WriteBinary(ctx, p.ArrowSchema); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.arrowSchema (1283) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:arrowSchema: ", p), err) + } + } + return err } func (p *TGetResultSetMetadataResp) writeField1284(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCacheLookupResult_() { - if err := oprot.WriteFieldBegin(ctx, "cacheLookupResult", thrift.I32, 1284); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:cacheLookupResult: ", p), err) } - if err := oprot.WriteI32(ctx, int32(*p.CacheLookupResult_)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.cacheLookupResult (1284) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:cacheLookupResult: ", p), err) } - } - return err + if p.IsSetCacheLookupResult_() { + if err := oprot.WriteFieldBegin(ctx, "cacheLookupResult", thrift.I32, 1284); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:cacheLookupResult: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(*p.CacheLookupResult_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cacheLookupResult (1284) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:cacheLookupResult: ", p), err) + } + } + return err } func (p *TGetResultSetMetadataResp) writeField1285(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetUncompressedBytes() { - if err := oprot.WriteFieldBegin(ctx, "uncompressedBytes", thrift.I64, 1285); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:uncompressedBytes: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.UncompressedBytes)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.uncompressedBytes (1285) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:uncompressedBytes: ", p), err) } - } - return err + if p.IsSetUncompressedBytes() { + if err := oprot.WriteFieldBegin(ctx, "uncompressedBytes", thrift.I64, 1285); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:uncompressedBytes: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.UncompressedBytes)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.uncompressedBytes (1285) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:uncompressedBytes: ", p), err) + } + } + return err } func (p *TGetResultSetMetadataResp) writeField1286(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCompressedBytes() { - if err := oprot.WriteFieldBegin(ctx, "compressedBytes", thrift.I64, 1286); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1286:compressedBytes: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.CompressedBytes)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.compressedBytes (1286) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1286:compressedBytes: ", p), err) } - } - return err + if p.IsSetCompressedBytes() { + if err := oprot.WriteFieldBegin(ctx, "compressedBytes", thrift.I64, 1286); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1286:compressedBytes: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.CompressedBytes)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.compressedBytes (1286) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1286:compressedBytes: ", p), err) + } + } + return err } func (p *TGetResultSetMetadataResp) writeField1287(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetIsStagingOperation() { - if err := oprot.WriteFieldBegin(ctx, "isStagingOperation", thrift.BOOL, 1287); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1287:isStagingOperation: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.IsStagingOperation)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.isStagingOperation (1287) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1287:isStagingOperation: ", p), err) } - } - return err + if p.IsSetIsStagingOperation() { + if err := oprot.WriteFieldBegin(ctx, "isStagingOperation", thrift.BOOL, 1287); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1287:isStagingOperation: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.IsStagingOperation)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.isStagingOperation (1287) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1287:isStagingOperation: ", p), err) + } + } + return err } func (p *TGetResultSetMetadataResp) Equals(other *TGetResultSetMetadataResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if !p.Schema.Equals(other.Schema) { return false } - if p.ResultFormat != other.ResultFormat { - if p.ResultFormat == nil || other.ResultFormat == nil { - return false - } - if (*p.ResultFormat) != (*other.ResultFormat) { return false } - } - if p.Lz4Compressed != other.Lz4Compressed { - if p.Lz4Compressed == nil || other.Lz4Compressed == nil { - return false - } - if (*p.Lz4Compressed) != (*other.Lz4Compressed) { return false } - } - if bytes.Compare(p.ArrowSchema, other.ArrowSchema) != 0 { return false } - if p.CacheLookupResult_ != other.CacheLookupResult_ { - if p.CacheLookupResult_ == nil || other.CacheLookupResult_ == nil { - return false - } - if (*p.CacheLookupResult_) != (*other.CacheLookupResult_) { return false } - } - if p.UncompressedBytes != other.UncompressedBytes { - if p.UncompressedBytes == nil || other.UncompressedBytes == nil { - return false - } - if (*p.UncompressedBytes) != (*other.UncompressedBytes) { return false } - } - if p.CompressedBytes != other.CompressedBytes { - if p.CompressedBytes == nil || other.CompressedBytes == nil { - return false - } - if (*p.CompressedBytes) != (*other.CompressedBytes) { return false } - } - if p.IsStagingOperation != other.IsStagingOperation { - if p.IsStagingOperation == nil || other.IsStagingOperation == nil { - return false - } - if (*p.IsStagingOperation) != (*other.IsStagingOperation) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if !p.Schema.Equals(other.Schema) { + return false + } + if p.ResultFormat != other.ResultFormat { + if p.ResultFormat == nil || other.ResultFormat == nil { + return false + } + if (*p.ResultFormat) != (*other.ResultFormat) { + return false + } + } + if p.Lz4Compressed != other.Lz4Compressed { + if p.Lz4Compressed == nil || other.Lz4Compressed == nil { + return false + } + if (*p.Lz4Compressed) != (*other.Lz4Compressed) { + return false + } + } + if bytes.Compare(p.ArrowSchema, other.ArrowSchema) != 0 { + return false + } + if p.CacheLookupResult_ != other.CacheLookupResult_ { + if p.CacheLookupResult_ == nil || other.CacheLookupResult_ == nil { + return false + } + if (*p.CacheLookupResult_) != (*other.CacheLookupResult_) { + return false + } + } + if p.UncompressedBytes != other.UncompressedBytes { + if p.UncompressedBytes == nil || other.UncompressedBytes == nil { + return false + } + if (*p.UncompressedBytes) != (*other.UncompressedBytes) { + return false + } + } + if p.CompressedBytes != other.CompressedBytes { + if p.CompressedBytes == nil || other.CompressedBytes == nil { + return false + } + if (*p.CompressedBytes) != (*other.CompressedBytes) { + return false + } + } + if p.IsStagingOperation != other.IsStagingOperation { + if p.IsStagingOperation == nil || other.IsStagingOperation == nil { + return false + } + if (*p.IsStagingOperation) != (*other.IsStagingOperation) { + return false + } + } + return true } func (p *TGetResultSetMetadataResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetResultSetMetadataResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetResultSetMetadataResp(%+v)", *p) } func (p *TGetResultSetMetadataResp) Validate() error { - return nil + return nil } + // Attributes: -// - OperationHandle -// - Orientation -// - MaxRows -// - FetchType -// - MaxBytes -// - StartRowOffset -// - IncludeResultSetMetadata +// - OperationHandle +// - Orientation +// - MaxRows +// - FetchType +// - MaxBytes +// - StartRowOffset +// - IncludeResultSetMetadata type TFetchResultsReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` - Orientation TFetchOrientation `thrift:"orientation,2,required" db:"orientation" json:"orientation"` - MaxRows int64 `thrift:"maxRows,3,required" db:"maxRows" json:"maxRows"` - FetchType int16 `thrift:"fetchType,4" db:"fetchType" json:"fetchType"` - // unused fields # 5 to 1280 - MaxBytes *int64 `thrift:"maxBytes,1281" db:"maxBytes" json:"maxBytes,omitempty"` - StartRowOffset *int64 `thrift:"startRowOffset,1282" db:"startRowOffset" json:"startRowOffset,omitempty"` - IncludeResultSetMetadata *bool `thrift:"includeResultSetMetadata,1283" db:"includeResultSetMetadata" json:"includeResultSetMetadata,omitempty"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + Orientation TFetchOrientation `thrift:"orientation,2,required" db:"orientation" json:"orientation"` + MaxRows int64 `thrift:"maxRows,3,required" db:"maxRows" json:"maxRows"` + FetchType int16 `thrift:"fetchType,4" db:"fetchType" json:"fetchType"` + // unused fields # 5 to 1280 + MaxBytes *int64 `thrift:"maxBytes,1281" db:"maxBytes" json:"maxBytes,omitempty"` + StartRowOffset *int64 `thrift:"startRowOffset,1282" db:"startRowOffset" json:"startRowOffset,omitempty"` + IncludeResultSetMetadata *bool `thrift:"includeResultSetMetadata,1283" db:"includeResultSetMetadata" json:"includeResultSetMetadata,omitempty"` } func NewTFetchResultsReq() *TFetchResultsReq { - return &TFetchResultsReq{ -Orientation: 0, -} + return &TFetchResultsReq{ + Orientation: 0, + } } var TFetchResultsReq_OperationHandle_DEFAULT *TOperationHandle + func (p *TFetchResultsReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TFetchResultsReq_OperationHandle_DEFAULT - } -return p.OperationHandle + if !p.IsSetOperationHandle() { + return TFetchResultsReq_OperationHandle_DEFAULT + } + return p.OperationHandle } func (p *TFetchResultsReq) GetOrientation() TFetchOrientation { - return p.Orientation + return p.Orientation } func (p *TFetchResultsReq) GetMaxRows() int64 { - return p.MaxRows + return p.MaxRows } + var TFetchResultsReq_FetchType_DEFAULT int16 = 0 func (p *TFetchResultsReq) GetFetchType() int16 { - return p.FetchType + return p.FetchType } + var TFetchResultsReq_MaxBytes_DEFAULT int64 + func (p *TFetchResultsReq) GetMaxBytes() int64 { - if !p.IsSetMaxBytes() { - return TFetchResultsReq_MaxBytes_DEFAULT - } -return *p.MaxBytes + if !p.IsSetMaxBytes() { + return TFetchResultsReq_MaxBytes_DEFAULT + } + return *p.MaxBytes } + var TFetchResultsReq_StartRowOffset_DEFAULT int64 + func (p *TFetchResultsReq) GetStartRowOffset() int64 { - if !p.IsSetStartRowOffset() { - return TFetchResultsReq_StartRowOffset_DEFAULT - } -return *p.StartRowOffset + if !p.IsSetStartRowOffset() { + return TFetchResultsReq_StartRowOffset_DEFAULT + } + return *p.StartRowOffset } + var TFetchResultsReq_IncludeResultSetMetadata_DEFAULT bool + func (p *TFetchResultsReq) GetIncludeResultSetMetadata() bool { - if !p.IsSetIncludeResultSetMetadata() { - return TFetchResultsReq_IncludeResultSetMetadata_DEFAULT - } -return *p.IncludeResultSetMetadata + if !p.IsSetIncludeResultSetMetadata() { + return TFetchResultsReq_IncludeResultSetMetadata_DEFAULT + } + return *p.IncludeResultSetMetadata } func (p *TFetchResultsReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TFetchResultsReq) IsSetFetchType() bool { - return p.FetchType != TFetchResultsReq_FetchType_DEFAULT + return p.FetchType != TFetchResultsReq_FetchType_DEFAULT } func (p *TFetchResultsReq) IsSetMaxBytes() bool { - return p.MaxBytes != nil + return p.MaxBytes != nil } func (p *TFetchResultsReq) IsSetStartRowOffset() bool { - return p.StartRowOffset != nil + return p.StartRowOffset != nil } func (p *TFetchResultsReq) IsSetIncludeResultSetMetadata() bool { - return p.IncludeResultSetMetadata != nil + return p.IncludeResultSetMetadata != nil } func (p *TFetchResultsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false; - var issetOrientation bool = false; - var issetMaxRows bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetOrientation = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I64 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetMaxRows = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I16 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1283: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1283(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); - } - if !issetOrientation{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Orientation is not set")); - } - if !issetMaxRows{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxRows is not set")); - } - return nil -} - -func (p *TFetchResultsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TFetchResultsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - temp := TFetchOrientation(v) - p.Orientation = temp -} - return nil -} - -func (p *TFetchResultsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.MaxRows = v -} - return nil -} - -func (p *TFetchResultsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - p.FetchType = v -} - return nil -} - -func (p *TFetchResultsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1281: ", err) -} else { - p.MaxBytes = &v -} - return nil -} - -func (p *TFetchResultsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) -} else { - p.StartRowOffset = &v -} - return nil -} - -func (p *TFetchResultsReq) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1283: ", err) -} else { - p.IncludeResultSetMetadata = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperationHandle bool = false + var issetOrientation bool = false + var issetMaxRows bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetOrientation = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetMaxRows = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I16 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1283: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1283(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperationHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")) + } + if !issetOrientation { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Orientation is not set")) + } + if !issetMaxRows { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxRows is not set")) + } + return nil +} + +func (p *TFetchResultsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TFetchResultsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + temp := TFetchOrientation(v) + p.Orientation = temp + } + return nil +} + +func (p *TFetchResultsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.MaxRows = v + } + return nil +} + +func (p *TFetchResultsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.FetchType = v + } + return nil +} + +func (p *TFetchResultsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1281: ", err) + } else { + p.MaxBytes = &v + } + return nil +} + +func (p *TFetchResultsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) + } else { + p.StartRowOffset = &v + } + return nil +} + +func (p *TFetchResultsReq) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1283: ", err) + } else { + p.IncludeResultSetMetadata = &v + } + return nil } func (p *TFetchResultsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TFetchResultsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - if err := p.writeField1282(ctx, oprot); err != nil { return err } - if err := p.writeField1283(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TFetchResultsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + if err := p.writeField1282(ctx, oprot); err != nil { + return err + } + if err := p.writeField1283(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TFetchResultsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) + } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) + } + return err } func (p *TFetchResultsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "orientation", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:orientation: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.Orientation)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.orientation (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:orientation: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "orientation", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:orientation: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.Orientation)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.orientation (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:orientation: ", p), err) + } + return err } func (p *TFetchResultsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "maxRows", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:maxRows: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.MaxRows)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxRows (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:maxRows: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "maxRows", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:maxRows: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.MaxRows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxRows (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:maxRows: ", p), err) + } + return err } func (p *TFetchResultsReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetFetchType() { - if err := oprot.WriteFieldBegin(ctx, "fetchType", thrift.I16, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fetchType: ", p), err) } - if err := oprot.WriteI16(ctx, int16(p.FetchType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.fetchType (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fetchType: ", p), err) } - } - return err + if p.IsSetFetchType() { + if err := oprot.WriteFieldBegin(ctx, "fetchType", thrift.I16, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fetchType: ", p), err) + } + if err := oprot.WriteI16(ctx, int16(p.FetchType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fetchType (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fetchType: ", p), err) + } + } + return err } func (p *TFetchResultsReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetMaxBytes() { - if err := oprot.WriteFieldBegin(ctx, "maxBytes", thrift.I64, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:maxBytes: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.MaxBytes)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxBytes (1281) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:maxBytes: ", p), err) } - } - return err + if p.IsSetMaxBytes() { + if err := oprot.WriteFieldBegin(ctx, "maxBytes", thrift.I64, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:maxBytes: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.MaxBytes)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxBytes (1281) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:maxBytes: ", p), err) + } + } + return err } func (p *TFetchResultsReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStartRowOffset() { - if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:startRowOffset: ", p), err) } - if err := oprot.WriteI64(ctx, int64(*p.StartRowOffset)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (1282) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:startRowOffset: ", p), err) } - } - return err + if p.IsSetStartRowOffset() { + if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:startRowOffset: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(*p.StartRowOffset)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (1282) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:startRowOffset: ", p), err) + } + } + return err } func (p *TFetchResultsReq) writeField1283(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetIncludeResultSetMetadata() { - if err := oprot.WriteFieldBegin(ctx, "includeResultSetMetadata", thrift.BOOL, 1283); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:includeResultSetMetadata: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.IncludeResultSetMetadata)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.includeResultSetMetadata (1283) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:includeResultSetMetadata: ", p), err) } - } - return err + if p.IsSetIncludeResultSetMetadata() { + if err := oprot.WriteFieldBegin(ctx, "includeResultSetMetadata", thrift.BOOL, 1283); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:includeResultSetMetadata: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.IncludeResultSetMetadata)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.includeResultSetMetadata (1283) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:includeResultSetMetadata: ", p), err) + } + } + return err } func (p *TFetchResultsReq) Equals(other *TFetchResultsReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { return false } - if p.Orientation != other.Orientation { return false } - if p.MaxRows != other.MaxRows { return false } - if p.FetchType != other.FetchType { return false } - if p.MaxBytes != other.MaxBytes { - if p.MaxBytes == nil || other.MaxBytes == nil { - return false - } - if (*p.MaxBytes) != (*other.MaxBytes) { return false } - } - if p.StartRowOffset != other.StartRowOffset { - if p.StartRowOffset == nil || other.StartRowOffset == nil { - return false - } - if (*p.StartRowOffset) != (*other.StartRowOffset) { return false } - } - if p.IncludeResultSetMetadata != other.IncludeResultSetMetadata { - if p.IncludeResultSetMetadata == nil || other.IncludeResultSetMetadata == nil { - return false - } - if (*p.IncludeResultSetMetadata) != (*other.IncludeResultSetMetadata) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { + return false + } + if p.Orientation != other.Orientation { + return false + } + if p.MaxRows != other.MaxRows { + return false + } + if p.FetchType != other.FetchType { + return false + } + if p.MaxBytes != other.MaxBytes { + if p.MaxBytes == nil || other.MaxBytes == nil { + return false + } + if (*p.MaxBytes) != (*other.MaxBytes) { + return false + } + } + if p.StartRowOffset != other.StartRowOffset { + if p.StartRowOffset == nil || other.StartRowOffset == nil { + return false + } + if (*p.StartRowOffset) != (*other.StartRowOffset) { + return false + } + } + if p.IncludeResultSetMetadata != other.IncludeResultSetMetadata { + if p.IncludeResultSetMetadata == nil || other.IncludeResultSetMetadata == nil { + return false + } + if (*p.IncludeResultSetMetadata) != (*other.IncludeResultSetMetadata) { + return false + } + } + return true } func (p *TFetchResultsReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TFetchResultsReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TFetchResultsReq(%+v)", *p) } func (p *TFetchResultsReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - HasMoreRows -// - Results -// - ResultSetMetadata +// - Status +// - HasMoreRows +// - Results +// - ResultSetMetadata type TFetchResultsResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - HasMoreRows *bool `thrift:"hasMoreRows,2" db:"hasMoreRows" json:"hasMoreRows,omitempty"` - Results *TRowSet `thrift:"results,3" db:"results" json:"results,omitempty"` - // unused fields # 4 to 1280 - ResultSetMetadata *TGetResultSetMetadataResp `thrift:"resultSetMetadata,1281" db:"resultSetMetadata" json:"resultSetMetadata,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + HasMoreRows *bool `thrift:"hasMoreRows,2" db:"hasMoreRows" json:"hasMoreRows,omitempty"` + Results *TRowSet `thrift:"results,3" db:"results" json:"results,omitempty"` + // unused fields # 4 to 1280 + ResultSetMetadata *TGetResultSetMetadataResp `thrift:"resultSetMetadata,1281" db:"resultSetMetadata" json:"resultSetMetadata,omitempty"` } func NewTFetchResultsResp() *TFetchResultsResp { - return &TFetchResultsResp{} + return &TFetchResultsResp{} } var TFetchResultsResp_Status_DEFAULT *TStatus + func (p *TFetchResultsResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TFetchResultsResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TFetchResultsResp_Status_DEFAULT + } + return p.Status } + var TFetchResultsResp_HasMoreRows_DEFAULT bool + func (p *TFetchResultsResp) GetHasMoreRows() bool { - if !p.IsSetHasMoreRows() { - return TFetchResultsResp_HasMoreRows_DEFAULT - } -return *p.HasMoreRows + if !p.IsSetHasMoreRows() { + return TFetchResultsResp_HasMoreRows_DEFAULT + } + return *p.HasMoreRows } + var TFetchResultsResp_Results_DEFAULT *TRowSet + func (p *TFetchResultsResp) GetResults() *TRowSet { - if !p.IsSetResults() { - return TFetchResultsResp_Results_DEFAULT - } -return p.Results + if !p.IsSetResults() { + return TFetchResultsResp_Results_DEFAULT + } + return p.Results } + var TFetchResultsResp_ResultSetMetadata_DEFAULT *TGetResultSetMetadataResp + func (p *TFetchResultsResp) GetResultSetMetadata() *TGetResultSetMetadataResp { - if !p.IsSetResultSetMetadata() { - return TFetchResultsResp_ResultSetMetadata_DEFAULT - } -return p.ResultSetMetadata + if !p.IsSetResultSetMetadata() { + return TFetchResultsResp_ResultSetMetadata_DEFAULT + } + return p.ResultSetMetadata } func (p *TFetchResultsResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TFetchResultsResp) IsSetHasMoreRows() bool { - return p.HasMoreRows != nil + return p.HasMoreRows != nil } func (p *TFetchResultsResp) IsSetResults() bool { - return p.Results != nil + return p.Results != nil } func (p *TFetchResultsResp) IsSetResultSetMetadata() bool { - return p.ResultSetMetadata != nil + return p.ResultSetMetadata != nil } func (p *TFetchResultsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TFetchResultsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TFetchResultsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.HasMoreRows = &v -} - return nil -} - -func (p *TFetchResultsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.Results = &TRowSet{} - if err := p.Results.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Results), err) - } - return nil -} - -func (p *TFetchResultsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.ResultSetMetadata = &TGetResultSetMetadataResp{} - if err := p.ResultSetMetadata.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ResultSetMetadata), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TFetchResultsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TFetchResultsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.HasMoreRows = &v + } + return nil +} + +func (p *TFetchResultsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Results = &TRowSet{} + if err := p.Results.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Results), err) + } + return nil +} + +func (p *TFetchResultsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.ResultSetMetadata = &TGetResultSetMetadataResp{} + if err := p.ResultSetMetadata.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ResultSetMetadata), err) + } + return nil } func (p *TFetchResultsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TFetchResultsResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField1281(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TFetchResultsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField1281(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TFetchResultsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TFetchResultsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetHasMoreRows() { - if err := oprot.WriteFieldBegin(ctx, "hasMoreRows", thrift.BOOL, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hasMoreRows: ", p), err) } - if err := oprot.WriteBool(ctx, bool(*p.HasMoreRows)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.hasMoreRows (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hasMoreRows: ", p), err) } - } - return err + if p.IsSetHasMoreRows() { + if err := oprot.WriteFieldBegin(ctx, "hasMoreRows", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hasMoreRows: ", p), err) + } + if err := oprot.WriteBool(ctx, bool(*p.HasMoreRows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hasMoreRows (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hasMoreRows: ", p), err) + } + } + return err } func (p *TFetchResultsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResults() { - if err := oprot.WriteFieldBegin(ctx, "results", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:results: ", p), err) } - if err := p.Results.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Results), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:results: ", p), err) } - } - return err + if p.IsSetResults() { + if err := oprot.WriteFieldBegin(ctx, "results", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:results: ", p), err) + } + if err := p.Results.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Results), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:results: ", p), err) + } + } + return err } func (p *TFetchResultsResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResultSetMetadata() { - if err := oprot.WriteFieldBegin(ctx, "resultSetMetadata", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:resultSetMetadata: ", p), err) } - if err := p.ResultSetMetadata.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ResultSetMetadata), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:resultSetMetadata: ", p), err) } - } - return err + if p.IsSetResultSetMetadata() { + if err := oprot.WriteFieldBegin(ctx, "resultSetMetadata", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:resultSetMetadata: ", p), err) + } + if err := p.ResultSetMetadata.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ResultSetMetadata), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:resultSetMetadata: ", p), err) + } + } + return err } func (p *TFetchResultsResp) Equals(other *TFetchResultsResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if p.HasMoreRows != other.HasMoreRows { - if p.HasMoreRows == nil || other.HasMoreRows == nil { - return false - } - if (*p.HasMoreRows) != (*other.HasMoreRows) { return false } - } - if !p.Results.Equals(other.Results) { return false } - if !p.ResultSetMetadata.Equals(other.ResultSetMetadata) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if p.HasMoreRows != other.HasMoreRows { + if p.HasMoreRows == nil || other.HasMoreRows == nil { + return false + } + if (*p.HasMoreRows) != (*other.HasMoreRows) { + return false + } + } + if !p.Results.Equals(other.Results) { + return false + } + if !p.ResultSetMetadata.Equals(other.ResultSetMetadata) { + return false + } + return true } func (p *TFetchResultsResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TFetchResultsResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TFetchResultsResp(%+v)", *p) } func (p *TFetchResultsResp) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - Owner -// - Renewer +// - SessionHandle +// - Owner +// - Renewer type TGetDelegationTokenReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - Owner string `thrift:"owner,2,required" db:"owner" json:"owner"` - Renewer string `thrift:"renewer,3,required" db:"renewer" json:"renewer"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + Owner string `thrift:"owner,2,required" db:"owner" json:"owner"` + Renewer string `thrift:"renewer,3,required" db:"renewer" json:"renewer"` } func NewTGetDelegationTokenReq() *TGetDelegationTokenReq { - return &TGetDelegationTokenReq{} + return &TGetDelegationTokenReq{} } var TGetDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TGetDelegationTokenReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetDelegationTokenReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetDelegationTokenReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TGetDelegationTokenReq) GetOwner() string { - return p.Owner + return p.Owner } func (p *TGetDelegationTokenReq) GetRenewer() string { - return p.Renewer + return p.Renewer } func (p *TGetDelegationTokenReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetDelegationTokenReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - var issetOwner bool = false; - var issetRenewer bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetOwner = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetRenewer = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - if !issetOwner{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Owner is not set")); - } - if !issetRenewer{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Renewer is not set")); - } - return nil -} - -func (p *TGetDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Owner = v -} - return nil -} - -func (p *TGetDelegationTokenReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.Renewer = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + var issetOwner bool = false + var issetRenewer bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetOwner = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetRenewer = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + if !issetOwner { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Owner is not set")) + } + if !issetRenewer { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Renewer is not set")) + } + return nil +} + +func (p *TGetDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Owner = v + } + return nil +} + +func (p *TGetDelegationTokenReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.Renewer = v + } + return nil } func (p *TGetDelegationTokenReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetDelegationTokenReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetDelegationTokenReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetDelegationTokenReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TGetDelegationTokenReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "owner", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:owner: ", p), err) } - if err := oprot.WriteString(ctx, string(p.Owner)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.owner (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:owner: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "owner", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:owner: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.Owner)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.owner (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:owner: ", p), err) + } + return err } func (p *TGetDelegationTokenReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "renewer", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:renewer: ", p), err) } - if err := oprot.WriteString(ctx, string(p.Renewer)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.renewer (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:renewer: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "renewer", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:renewer: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.Renewer)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.renewer (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:renewer: ", p), err) + } + return err } func (p *TGetDelegationTokenReq) Equals(other *TGetDelegationTokenReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.Owner != other.Owner { return false } - if p.Renewer != other.Renewer { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if p.Owner != other.Owner { + return false + } + if p.Renewer != other.Renewer { + return false + } + return true } func (p *TGetDelegationTokenReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetDelegationTokenReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetDelegationTokenReq(%+v)", *p) } func (p *TGetDelegationTokenReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status -// - DelegationToken +// - Status +// - DelegationToken type TGetDelegationTokenResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - DelegationToken *string `thrift:"delegationToken,2" db:"delegationToken" json:"delegationToken,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + DelegationToken *string `thrift:"delegationToken,2" db:"delegationToken" json:"delegationToken,omitempty"` } func NewTGetDelegationTokenResp() *TGetDelegationTokenResp { - return &TGetDelegationTokenResp{} + return &TGetDelegationTokenResp{} } var TGetDelegationTokenResp_Status_DEFAULT *TStatus + func (p *TGetDelegationTokenResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetDelegationTokenResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TGetDelegationTokenResp_Status_DEFAULT + } + return p.Status } + var TGetDelegationTokenResp_DelegationToken_DEFAULT string + func (p *TGetDelegationTokenResp) GetDelegationToken() string { - if !p.IsSetDelegationToken() { - return TGetDelegationTokenResp_DelegationToken_DEFAULT - } -return *p.DelegationToken + if !p.IsSetDelegationToken() { + return TGetDelegationTokenResp_DelegationToken_DEFAULT + } + return *p.DelegationToken } func (p *TGetDelegationTokenResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetDelegationTokenResp) IsSetDelegationToken() bool { - return p.DelegationToken != nil + return p.DelegationToken != nil } func (p *TGetDelegationTokenResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TGetDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetDelegationTokenResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.DelegationToken = &v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TGetDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetDelegationTokenResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.DelegationToken = &v + } + return nil } func (p *TGetDelegationTokenResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetDelegationTokenResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetDelegationTokenResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TGetDelegationTokenResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TGetDelegationTokenResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDelegationToken() { - if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } - if err := oprot.WriteString(ctx, string(*p.DelegationToken)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } - } - return err + if p.IsSetDelegationToken() { + if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) + } + if err := oprot.WriteString(ctx, string(*p.DelegationToken)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) + } + } + return err } func (p *TGetDelegationTokenResp) Equals(other *TGetDelegationTokenResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - if p.DelegationToken != other.DelegationToken { - if p.DelegationToken == nil || other.DelegationToken == nil { - return false - } - if (*p.DelegationToken) != (*other.DelegationToken) { return false } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + if p.DelegationToken != other.DelegationToken { + if p.DelegationToken == nil || other.DelegationToken == nil { + return false + } + if (*p.DelegationToken) != (*other.DelegationToken) { + return false + } + } + return true } func (p *TGetDelegationTokenResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetDelegationTokenResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetDelegationTokenResp(%+v)", *p) } func (p *TGetDelegationTokenResp) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - DelegationToken +// - SessionHandle +// - DelegationToken type TCancelDelegationTokenReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"` } func NewTCancelDelegationTokenReq() *TCancelDelegationTokenReq { - return &TCancelDelegationTokenReq{} + return &TCancelDelegationTokenReq{} } var TCancelDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TCancelDelegationTokenReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TCancelDelegationTokenReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TCancelDelegationTokenReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TCancelDelegationTokenReq) GetDelegationToken() string { - return p.DelegationToken + return p.DelegationToken } func (p *TCancelDelegationTokenReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TCancelDelegationTokenReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - var issetDelegationToken bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetDelegationToken = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - if !issetDelegationToken{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set")); - } - return nil -} - -func (p *TCancelDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TCancelDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.DelegationToken = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + var issetDelegationToken bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetDelegationToken = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + if !issetDelegationToken { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set")) + } + return nil +} + +func (p *TCancelDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TCancelDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.DelegationToken = v + } + return nil } func (p *TCancelDelegationTokenReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCancelDelegationTokenReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TCancelDelegationTokenReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCancelDelegationTokenReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TCancelDelegationTokenReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } - if err := oprot.WriteString(ctx, string(p.DelegationToken)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.DelegationToken)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) + } + return err } func (p *TCancelDelegationTokenReq) Equals(other *TCancelDelegationTokenReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.DelegationToken != other.DelegationToken { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if p.DelegationToken != other.DelegationToken { + return false + } + return true } func (p *TCancelDelegationTokenReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCancelDelegationTokenReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCancelDelegationTokenReq(%+v)", *p) } func (p *TCancelDelegationTokenReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status +// - Status type TCancelDelegationTokenResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTCancelDelegationTokenResp() *TCancelDelegationTokenResp { - return &TCancelDelegationTokenResp{} + return &TCancelDelegationTokenResp{} } var TCancelDelegationTokenResp_Status_DEFAULT *TStatus + func (p *TCancelDelegationTokenResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCancelDelegationTokenResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TCancelDelegationTokenResp_Status_DEFAULT + } + return p.Status } func (p *TCancelDelegationTokenResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TCancelDelegationTokenResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TCancelDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TCancelDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil } func (p *TCancelDelegationTokenResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCancelDelegationTokenResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TCancelDelegationTokenResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCancelDelegationTokenResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TCancelDelegationTokenResp) Equals(other *TCancelDelegationTokenResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + return true } func (p *TCancelDelegationTokenResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCancelDelegationTokenResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCancelDelegationTokenResp(%+v)", *p) } func (p *TCancelDelegationTokenResp) Validate() error { - return nil + return nil } + // Attributes: -// - SessionHandle -// - DelegationToken +// - SessionHandle +// - DelegationToken type TRenewDelegationTokenReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"` } func NewTRenewDelegationTokenReq() *TRenewDelegationTokenReq { - return &TRenewDelegationTokenReq{} + return &TRenewDelegationTokenReq{} } var TRenewDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle + func (p *TRenewDelegationTokenReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TRenewDelegationTokenReq_SessionHandle_DEFAULT - } -return p.SessionHandle + if !p.IsSetSessionHandle() { + return TRenewDelegationTokenReq_SessionHandle_DEFAULT + } + return p.SessionHandle } func (p *TRenewDelegationTokenReq) GetDelegationToken() string { - return p.DelegationToken + return p.DelegationToken } func (p *TRenewDelegationTokenReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TRenewDelegationTokenReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false; - var issetDelegationToken bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetDelegationToken = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - if !issetDelegationToken{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set")); - } - return nil -} - -func (p *TRenewDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TRenewDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.DelegationToken = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false + var issetDelegationToken bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetDelegationToken = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) + } + if !issetDelegationToken { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set")) + } + return nil +} + +func (p *TRenewDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TRenewDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.DelegationToken = v + } + return nil } func (p *TRenewDelegationTokenReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TRenewDelegationTokenReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TRenewDelegationTokenReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TRenewDelegationTokenReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) + } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) + } + return err } func (p *TRenewDelegationTokenReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } - if err := oprot.WriteString(ctx, string(p.DelegationToken)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.DelegationToken)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) + } + return err } func (p *TRenewDelegationTokenReq) Equals(other *TRenewDelegationTokenReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { return false } - if p.DelegationToken != other.DelegationToken { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { + return false + } + if p.DelegationToken != other.DelegationToken { + return false + } + return true } func (p *TRenewDelegationTokenReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TRenewDelegationTokenReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TRenewDelegationTokenReq(%+v)", *p) } func (p *TRenewDelegationTokenReq) Validate() error { - return nil + return nil } + // Attributes: -// - Status +// - Status type TRenewDelegationTokenResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTRenewDelegationTokenResp() *TRenewDelegationTokenResp { - return &TRenewDelegationTokenResp{} + return &TRenewDelegationTokenResp{} } var TRenewDelegationTokenResp_Status_DEFAULT *TStatus + func (p *TRenewDelegationTokenResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TRenewDelegationTokenResp_Status_DEFAULT - } -return p.Status + if !p.IsSetStatus() { + return TRenewDelegationTokenResp_Status_DEFAULT + } + return p.Status } func (p *TRenewDelegationTokenResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TRenewDelegationTokenResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TRenewDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + return nil +} + +func (p *TRenewDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil } func (p *TRenewDelegationTokenResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TRenewDelegationTokenResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TRenewDelegationTokenResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TRenewDelegationTokenResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) + } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) + } + return err } func (p *TRenewDelegationTokenResp) Equals(other *TRenewDelegationTokenResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { + return false + } + return true } func (p *TRenewDelegationTokenResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TRenewDelegationTokenResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TRenewDelegationTokenResp(%+v)", *p) } func (p *TRenewDelegationTokenResp) Validate() error { - return nil + return nil } + // Attributes: -// - HeaderNames -// - Rows -// - ProgressedPercentage -// - Status -// - FooterSummary -// - StartTime +// - HeaderNames +// - Rows +// - ProgressedPercentage +// - Status +// - FooterSummary +// - StartTime type TProgressUpdateResp struct { - HeaderNames []string `thrift:"headerNames,1,required" db:"headerNames" json:"headerNames"` - Rows [][]string `thrift:"rows,2,required" db:"rows" json:"rows"` - ProgressedPercentage float64 `thrift:"progressedPercentage,3,required" db:"progressedPercentage" json:"progressedPercentage"` - Status TJobExecutionStatus `thrift:"status,4,required" db:"status" json:"status"` - FooterSummary string `thrift:"footerSummary,5,required" db:"footerSummary" json:"footerSummary"` - StartTime int64 `thrift:"startTime,6,required" db:"startTime" json:"startTime"` + HeaderNames []string `thrift:"headerNames,1,required" db:"headerNames" json:"headerNames"` + Rows [][]string `thrift:"rows,2,required" db:"rows" json:"rows"` + ProgressedPercentage float64 `thrift:"progressedPercentage,3,required" db:"progressedPercentage" json:"progressedPercentage"` + Status TJobExecutionStatus `thrift:"status,4,required" db:"status" json:"status"` + FooterSummary string `thrift:"footerSummary,5,required" db:"footerSummary" json:"footerSummary"` + StartTime int64 `thrift:"startTime,6,required" db:"startTime" json:"startTime"` } func NewTProgressUpdateResp() *TProgressUpdateResp { - return &TProgressUpdateResp{} + return &TProgressUpdateResp{} } - func (p *TProgressUpdateResp) GetHeaderNames() []string { - return p.HeaderNames + return p.HeaderNames } func (p *TProgressUpdateResp) GetRows() [][]string { - return p.Rows + return p.Rows } func (p *TProgressUpdateResp) GetProgressedPercentage() float64 { - return p.ProgressedPercentage + return p.ProgressedPercentage } func (p *TProgressUpdateResp) GetStatus() TJobExecutionStatus { - return p.Status + return p.Status } func (p *TProgressUpdateResp) GetFooterSummary() string { - return p.FooterSummary + return p.FooterSummary } func (p *TProgressUpdateResp) GetStartTime() int64 { - return p.StartTime + return p.StartTime } func (p *TProgressUpdateResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetHeaderNames bool = false; - var issetRows bool = false; - var issetProgressedPercentage bool = false; - var issetStatus bool = false; - var issetFooterSummary bool = false; - var issetStartTime bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetHeaderNames = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.LIST { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetRows = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetProgressedPercentage = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I32 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - issetFooterSummary = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.I64 { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - issetStartTime = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetHeaderNames{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HeaderNames is not set")); - } - if !issetRows{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")); - } - if !issetProgressedPercentage{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ProgressedPercentage is not set")); - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - if !issetFooterSummary{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FooterSummary is not set")); - } - if !issetStartTime{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartTime is not set")); - } - return nil -} - -func (p *TProgressUpdateResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]string, 0, size) - p.HeaderNames = tSlice - for i := 0; i < size; i ++ { -var _elem68 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem68 = v -} - p.HeaderNames = append(p.HeaderNames, _elem68) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TProgressUpdateResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([][]string, 0, size) - p.Rows = tSlice - for i := 0; i < size; i ++ { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]string, 0, size) - _elem69 := tSlice - for i := 0; i < size; i ++ { -var _elem70 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) -} else { - _elem70 = v -} - _elem69 = append(_elem69, _elem70) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.Rows = append(p.Rows, _elem69) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TProgressUpdateResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.ProgressedPercentage = v -} - return nil -} - -func (p *TProgressUpdateResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) -} else { - temp := TJobExecutionStatus(v) - p.Status = temp -} - return nil -} - -func (p *TProgressUpdateResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.FooterSummary = v -} - return nil -} - -func (p *TProgressUpdateResp) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) -} else { - p.StartTime = v -} - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetHeaderNames bool = false + var issetRows bool = false + var issetProgressedPercentage bool = false + var issetStatus bool = false + var issetFooterSummary bool = false + var issetStartTime bool = false + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetHeaderNames = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetRows = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetProgressedPercentage = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + issetFooterSummary = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + issetStartTime = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetHeaderNames { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HeaderNames is not set")) + } + if !issetRows { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")) + } + if !issetProgressedPercentage { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ProgressedPercentage is not set")) + } + if !issetStatus { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) + } + if !issetFooterSummary { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FooterSummary is not set")) + } + if !issetStartTime { + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartTime is not set")) + } + return nil +} + +func (p *TProgressUpdateResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.HeaderNames = tSlice + for i := 0; i < size; i++ { + var _elem68 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem68 = v + } + p.HeaderNames = append(p.HeaderNames, _elem68) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TProgressUpdateResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]string, 0, size) + p.Rows = tSlice + for i := 0; i < size; i++ { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + _elem69 := tSlice + for i := 0; i < size; i++ { + var _elem70 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem70 = v + } + _elem69 = append(_elem69, _elem70) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Rows = append(p.Rows, _elem69) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TProgressUpdateResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.ProgressedPercentage = v + } + return nil +} + +func (p *TProgressUpdateResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + temp := TJobExecutionStatus(v) + p.Status = temp + } + return nil +} + +func (p *TProgressUpdateResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) + } else { + p.FooterSummary = v + } + return nil +} + +func (p *TProgressUpdateResp) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.StartTime = v + } + return nil } func (p *TProgressUpdateResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TProgressUpdateResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - if err := p.writeField2(ctx, oprot); err != nil { return err } - if err := p.writeField3(ctx, oprot); err != nil { return err } - if err := p.writeField4(ctx, oprot); err != nil { return err } - if err := p.writeField5(ctx, oprot); err != nil { return err } - if err := p.writeField6(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "TProgressUpdateResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + if err := p.writeField2(ctx, oprot); err != nil { + return err + } + if err := p.writeField3(ctx, oprot); err != nil { + return err + } + if err := p.writeField4(ctx, oprot); err != nil { + return err + } + if err := p.writeField5(ctx, oprot); err != nil { + return err + } + if err := p.writeField6(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TProgressUpdateResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "headerNames", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:headerNames: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.HeaderNames)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.HeaderNames { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:headerNames: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "headerNames", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:headerNames: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.HeaderNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.HeaderNames { + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:headerNames: ", p), err) + } + return err } func (p *TProgressUpdateResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "rows", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) } - if err := oprot.WriteListBegin(ctx, thrift.LIST, len(p.Rows)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Rows { - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(v)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range v { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rows: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "rows", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) + } + if err := oprot.WriteListBegin(ctx, thrift.LIST, len(p.Rows)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Rows { + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rows: ", p), err) + } + return err } func (p *TProgressUpdateResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "progressedPercentage", thrift.DOUBLE, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:progressedPercentage: ", p), err) } - if err := oprot.WriteDouble(ctx, float64(p.ProgressedPercentage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.progressedPercentage (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:progressedPercentage: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "progressedPercentage", thrift.DOUBLE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:progressedPercentage: ", p), err) + } + if err := oprot.WriteDouble(ctx, float64(p.ProgressedPercentage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.progressedPercentage (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:progressedPercentage: ", p), err) + } + return err } func (p *TProgressUpdateResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) } - if err := oprot.WriteI32(ctx, int32(p.Status)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) + } + if err := oprot.WriteI32(ctx, int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) + } + return err } func (p *TProgressUpdateResp) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "footerSummary", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:footerSummary: ", p), err) } - if err := oprot.WriteString(ctx, string(p.FooterSummary)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.footerSummary (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:footerSummary: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "footerSummary", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:footerSummary: ", p), err) + } + if err := oprot.WriteString(ctx, string(p.FooterSummary)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.footerSummary (5) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:footerSummary: ", p), err) + } + return err } func (p *TProgressUpdateResp) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "startTime", thrift.I64, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:startTime: ", p), err) } - if err := oprot.WriteI64(ctx, int64(p.StartTime)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.startTime (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:startTime: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "startTime", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:startTime: ", p), err) + } + if err := oprot.WriteI64(ctx, int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.startTime (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:startTime: ", p), err) + } + return err } func (p *TProgressUpdateResp) Equals(other *TProgressUpdateResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.HeaderNames) != len(other.HeaderNames) { return false } - for i, _tgt := range p.HeaderNames { - _src71 := other.HeaderNames[i] - if _tgt != _src71 { return false } - } - if len(p.Rows) != len(other.Rows) { return false } - for i, _tgt := range p.Rows { - _src72 := other.Rows[i] - if len(_tgt) != len(_src72) { return false } - for i, _tgt := range _tgt { - _src73 := _src72[i] - if _tgt != _src73 { return false } - } - } - if p.ProgressedPercentage != other.ProgressedPercentage { return false } - if p.Status != other.Status { return false } - if p.FooterSummary != other.FooterSummary { return false } - if p.StartTime != other.StartTime { return false } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.HeaderNames) != len(other.HeaderNames) { + return false + } + for i, _tgt := range p.HeaderNames { + _src71 := other.HeaderNames[i] + if _tgt != _src71 { + return false + } + } + if len(p.Rows) != len(other.Rows) { + return false + } + for i, _tgt := range p.Rows { + _src72 := other.Rows[i] + if len(_tgt) != len(_src72) { + return false + } + for i, _tgt := range _tgt { + _src73 := _src72[i] + if _tgt != _src73 { + return false + } + } + } + if p.ProgressedPercentage != other.ProgressedPercentage { + return false + } + if p.Status != other.Status { + return false + } + if p.FooterSummary != other.FooterSummary { + return false + } + if p.StartTime != other.StartTime { + return false + } + return true } func (p *TProgressUpdateResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TProgressUpdateResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TProgressUpdateResp(%+v)", *p) } func (p *TProgressUpdateResp) Validate() error { - return nil + return nil } + type TCLIService interface { - // Parameters: - // - Req - OpenSession(ctx context.Context, req *TOpenSessionReq) (_r *TOpenSessionResp, _err error) - // Parameters: - // - Req - CloseSession(ctx context.Context, req *TCloseSessionReq) (_r *TCloseSessionResp, _err error) - // Parameters: - // - Req - GetInfo(ctx context.Context, req *TGetInfoReq) (_r *TGetInfoResp, _err error) - // Parameters: - // - Req - ExecuteStatement(ctx context.Context, req *TExecuteStatementReq) (_r *TExecuteStatementResp, _err error) - // Parameters: - // - Req - GetTypeInfo(ctx context.Context, req *TGetTypeInfoReq) (_r *TGetTypeInfoResp, _err error) - // Parameters: - // - Req - GetCatalogs(ctx context.Context, req *TGetCatalogsReq) (_r *TGetCatalogsResp, _err error) - // Parameters: - // - Req - GetSchemas(ctx context.Context, req *TGetSchemasReq) (_r *TGetSchemasResp, _err error) - // Parameters: - // - Req - GetTables(ctx context.Context, req *TGetTablesReq) (_r *TGetTablesResp, _err error) - // Parameters: - // - Req - GetTableTypes(ctx context.Context, req *TGetTableTypesReq) (_r *TGetTableTypesResp, _err error) - // Parameters: - // - Req - GetColumns(ctx context.Context, req *TGetColumnsReq) (_r *TGetColumnsResp, _err error) - // Parameters: - // - Req - GetFunctions(ctx context.Context, req *TGetFunctionsReq) (_r *TGetFunctionsResp, _err error) - // Parameters: - // - Req - GetPrimaryKeys(ctx context.Context, req *TGetPrimaryKeysReq) (_r *TGetPrimaryKeysResp, _err error) - // Parameters: - // - Req - GetCrossReference(ctx context.Context, req *TGetCrossReferenceReq) (_r *TGetCrossReferenceResp, _err error) - // Parameters: - // - Req - GetOperationStatus(ctx context.Context, req *TGetOperationStatusReq) (_r *TGetOperationStatusResp, _err error) - // Parameters: - // - Req - CancelOperation(ctx context.Context, req *TCancelOperationReq) (_r *TCancelOperationResp, _err error) - // Parameters: - // - Req - CloseOperation(ctx context.Context, req *TCloseOperationReq) (_r *TCloseOperationResp, _err error) - // Parameters: - // - Req - GetResultSetMetadata(ctx context.Context, req *TGetResultSetMetadataReq) (_r *TGetResultSetMetadataResp, _err error) - // Parameters: - // - Req - FetchResults(ctx context.Context, req *TFetchResultsReq) (_r *TFetchResultsResp, _err error) - // Parameters: - // - Req - GetDelegationToken(ctx context.Context, req *TGetDelegationTokenReq) (_r *TGetDelegationTokenResp, _err error) - // Parameters: - // - Req - CancelDelegationToken(ctx context.Context, req *TCancelDelegationTokenReq) (_r *TCancelDelegationTokenResp, _err error) - // Parameters: - // - Req - RenewDelegationToken(ctx context.Context, req *TRenewDelegationTokenReq) (_r *TRenewDelegationTokenResp, _err error) + // Parameters: + // - Req + OpenSession(ctx context.Context, req *TOpenSessionReq) (_r *TOpenSessionResp, _err error) + // Parameters: + // - Req + CloseSession(ctx context.Context, req *TCloseSessionReq) (_r *TCloseSessionResp, _err error) + // Parameters: + // - Req + GetInfo(ctx context.Context, req *TGetInfoReq) (_r *TGetInfoResp, _err error) + // Parameters: + // - Req + ExecuteStatement(ctx context.Context, req *TExecuteStatementReq) (_r *TExecuteStatementResp, _err error) + // Parameters: + // - Req + GetTypeInfo(ctx context.Context, req *TGetTypeInfoReq) (_r *TGetTypeInfoResp, _err error) + // Parameters: + // - Req + GetCatalogs(ctx context.Context, req *TGetCatalogsReq) (_r *TGetCatalogsResp, _err error) + // Parameters: + // - Req + GetSchemas(ctx context.Context, req *TGetSchemasReq) (_r *TGetSchemasResp, _err error) + // Parameters: + // - Req + GetTables(ctx context.Context, req *TGetTablesReq) (_r *TGetTablesResp, _err error) + // Parameters: + // - Req + GetTableTypes(ctx context.Context, req *TGetTableTypesReq) (_r *TGetTableTypesResp, _err error) + // Parameters: + // - Req + GetColumns(ctx context.Context, req *TGetColumnsReq) (_r *TGetColumnsResp, _err error) + // Parameters: + // - Req + GetFunctions(ctx context.Context, req *TGetFunctionsReq) (_r *TGetFunctionsResp, _err error) + // Parameters: + // - Req + GetPrimaryKeys(ctx context.Context, req *TGetPrimaryKeysReq) (_r *TGetPrimaryKeysResp, _err error) + // Parameters: + // - Req + GetCrossReference(ctx context.Context, req *TGetCrossReferenceReq) (_r *TGetCrossReferenceResp, _err error) + // Parameters: + // - Req + GetOperationStatus(ctx context.Context, req *TGetOperationStatusReq) (_r *TGetOperationStatusResp, _err error) + // Parameters: + // - Req + CancelOperation(ctx context.Context, req *TCancelOperationReq) (_r *TCancelOperationResp, _err error) + // Parameters: + // - Req + CloseOperation(ctx context.Context, req *TCloseOperationReq) (_r *TCloseOperationResp, _err error) + // Parameters: + // - Req + GetResultSetMetadata(ctx context.Context, req *TGetResultSetMetadataReq) (_r *TGetResultSetMetadataResp, _err error) + // Parameters: + // - Req + FetchResults(ctx context.Context, req *TFetchResultsReq) (_r *TFetchResultsResp, _err error) + // Parameters: + // - Req + GetDelegationToken(ctx context.Context, req *TGetDelegationTokenReq) (_r *TGetDelegationTokenResp, _err error) + // Parameters: + // - Req + CancelDelegationToken(ctx context.Context, req *TCancelDelegationTokenReq) (_r *TCancelDelegationTokenResp, _err error) + // Parameters: + // - Req + RenewDelegationToken(ctx context.Context, req *TRenewDelegationTokenReq) (_r *TRenewDelegationTokenResp, _err error) } type TCLIServiceClient struct { - c thrift.TClient - meta thrift.ResponseMeta + c thrift.TClient + meta thrift.ResponseMeta } func NewTCLIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *TCLIServiceClient { - return &TCLIServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } + return &TCLIServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } } func NewTCLIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *TCLIServiceClient { - return &TCLIServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } + return &TCLIServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } } func NewTCLIServiceClient(c thrift.TClient) *TCLIServiceClient { - return &TCLIServiceClient{ - c: c, - } + return &TCLIServiceClient{ + c: c, + } } func (p *TCLIServiceClient) Client_() thrift.TClient { - return p.c + return p.c } func (p *TCLIServiceClient) LastResponseMeta_() thrift.ResponseMeta { - return p.meta + return p.meta } func (p *TCLIServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { - p.meta = meta + p.meta = meta } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) OpenSession(ctx context.Context, req *TOpenSessionReq) (_r *TOpenSessionResp, _err error) { - var _args74 TCLIServiceOpenSessionArgs - _args74.Req = req - var _result76 TCLIServiceOpenSessionResult - var _meta75 thrift.ResponseMeta - _meta75, _err = p.Client_().Call(ctx, "OpenSession", &_args74, &_result76) - p.SetLastResponseMeta_(_meta75) - if _err != nil { - return - } - if _ret77 := _result76.GetSuccess(); _ret77 != nil { - return _ret77, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "OpenSession failed: unknown result") + var _args74 TCLIServiceOpenSessionArgs + _args74.Req = req + var _result76 TCLIServiceOpenSessionResult + var _meta75 thrift.ResponseMeta + _meta75, _err = p.Client_().Call(ctx, "OpenSession", &_args74, &_result76) + p.SetLastResponseMeta_(_meta75) + if _err != nil { + return + } + if _ret77 := _result76.GetSuccess(); _ret77 != nil { + return _ret77, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "OpenSession failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) CloseSession(ctx context.Context, req *TCloseSessionReq) (_r *TCloseSessionResp, _err error) { - var _args78 TCLIServiceCloseSessionArgs - _args78.Req = req - var _result80 TCLIServiceCloseSessionResult - var _meta79 thrift.ResponseMeta - _meta79, _err = p.Client_().Call(ctx, "CloseSession", &_args78, &_result80) - p.SetLastResponseMeta_(_meta79) - if _err != nil { - return - } - if _ret81 := _result80.GetSuccess(); _ret81 != nil { - return _ret81, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CloseSession failed: unknown result") + var _args78 TCLIServiceCloseSessionArgs + _args78.Req = req + var _result80 TCLIServiceCloseSessionResult + var _meta79 thrift.ResponseMeta + _meta79, _err = p.Client_().Call(ctx, "CloseSession", &_args78, &_result80) + p.SetLastResponseMeta_(_meta79) + if _err != nil { + return + } + if _ret81 := _result80.GetSuccess(); _ret81 != nil { + return _ret81, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CloseSession failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetInfo(ctx context.Context, req *TGetInfoReq) (_r *TGetInfoResp, _err error) { - var _args82 TCLIServiceGetInfoArgs - _args82.Req = req - var _result84 TCLIServiceGetInfoResult - var _meta83 thrift.ResponseMeta - _meta83, _err = p.Client_().Call(ctx, "GetInfo", &_args82, &_result84) - p.SetLastResponseMeta_(_meta83) - if _err != nil { - return - } - if _ret85 := _result84.GetSuccess(); _ret85 != nil { - return _ret85, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetInfo failed: unknown result") + var _args82 TCLIServiceGetInfoArgs + _args82.Req = req + var _result84 TCLIServiceGetInfoResult + var _meta83 thrift.ResponseMeta + _meta83, _err = p.Client_().Call(ctx, "GetInfo", &_args82, &_result84) + p.SetLastResponseMeta_(_meta83) + if _err != nil { + return + } + if _ret85 := _result84.GetSuccess(); _ret85 != nil { + return _ret85, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetInfo failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) ExecuteStatement(ctx context.Context, req *TExecuteStatementReq) (_r *TExecuteStatementResp, _err error) { - var _args86 TCLIServiceExecuteStatementArgs - _args86.Req = req - var _result88 TCLIServiceExecuteStatementResult - var _meta87 thrift.ResponseMeta - _meta87, _err = p.Client_().Call(ctx, "ExecuteStatement", &_args86, &_result88) - p.SetLastResponseMeta_(_meta87) - if _err != nil { - return - } - if _ret89 := _result88.GetSuccess(); _ret89 != nil { - return _ret89, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "ExecuteStatement failed: unknown result") + var _args86 TCLIServiceExecuteStatementArgs + _args86.Req = req + var _result88 TCLIServiceExecuteStatementResult + var _meta87 thrift.ResponseMeta + _meta87, _err = p.Client_().Call(ctx, "ExecuteStatement", &_args86, &_result88) + p.SetLastResponseMeta_(_meta87) + if _err != nil { + return + } + if _ret89 := _result88.GetSuccess(); _ret89 != nil { + return _ret89, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "ExecuteStatement failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetTypeInfo(ctx context.Context, req *TGetTypeInfoReq) (_r *TGetTypeInfoResp, _err error) { - var _args90 TCLIServiceGetTypeInfoArgs - _args90.Req = req - var _result92 TCLIServiceGetTypeInfoResult - var _meta91 thrift.ResponseMeta - _meta91, _err = p.Client_().Call(ctx, "GetTypeInfo", &_args90, &_result92) - p.SetLastResponseMeta_(_meta91) - if _err != nil { - return - } - if _ret93 := _result92.GetSuccess(); _ret93 != nil { - return _ret93, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetTypeInfo failed: unknown result") + var _args90 TCLIServiceGetTypeInfoArgs + _args90.Req = req + var _result92 TCLIServiceGetTypeInfoResult + var _meta91 thrift.ResponseMeta + _meta91, _err = p.Client_().Call(ctx, "GetTypeInfo", &_args90, &_result92) + p.SetLastResponseMeta_(_meta91) + if _err != nil { + return + } + if _ret93 := _result92.GetSuccess(); _ret93 != nil { + return _ret93, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetTypeInfo failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetCatalogs(ctx context.Context, req *TGetCatalogsReq) (_r *TGetCatalogsResp, _err error) { - var _args94 TCLIServiceGetCatalogsArgs - _args94.Req = req - var _result96 TCLIServiceGetCatalogsResult - var _meta95 thrift.ResponseMeta - _meta95, _err = p.Client_().Call(ctx, "GetCatalogs", &_args94, &_result96) - p.SetLastResponseMeta_(_meta95) - if _err != nil { - return - } - if _ret97 := _result96.GetSuccess(); _ret97 != nil { - return _ret97, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetCatalogs failed: unknown result") + var _args94 TCLIServiceGetCatalogsArgs + _args94.Req = req + var _result96 TCLIServiceGetCatalogsResult + var _meta95 thrift.ResponseMeta + _meta95, _err = p.Client_().Call(ctx, "GetCatalogs", &_args94, &_result96) + p.SetLastResponseMeta_(_meta95) + if _err != nil { + return + } + if _ret97 := _result96.GetSuccess(); _ret97 != nil { + return _ret97, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetCatalogs failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetSchemas(ctx context.Context, req *TGetSchemasReq) (_r *TGetSchemasResp, _err error) { - var _args98 TCLIServiceGetSchemasArgs - _args98.Req = req - var _result100 TCLIServiceGetSchemasResult - var _meta99 thrift.ResponseMeta - _meta99, _err = p.Client_().Call(ctx, "GetSchemas", &_args98, &_result100) - p.SetLastResponseMeta_(_meta99) - if _err != nil { - return - } - if _ret101 := _result100.GetSuccess(); _ret101 != nil { - return _ret101, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetSchemas failed: unknown result") + var _args98 TCLIServiceGetSchemasArgs + _args98.Req = req + var _result100 TCLIServiceGetSchemasResult + var _meta99 thrift.ResponseMeta + _meta99, _err = p.Client_().Call(ctx, "GetSchemas", &_args98, &_result100) + p.SetLastResponseMeta_(_meta99) + if _err != nil { + return + } + if _ret101 := _result100.GetSuccess(); _ret101 != nil { + return _ret101, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetSchemas failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetTables(ctx context.Context, req *TGetTablesReq) (_r *TGetTablesResp, _err error) { - var _args102 TCLIServiceGetTablesArgs - _args102.Req = req - var _result104 TCLIServiceGetTablesResult - var _meta103 thrift.ResponseMeta - _meta103, _err = p.Client_().Call(ctx, "GetTables", &_args102, &_result104) - p.SetLastResponseMeta_(_meta103) - if _err != nil { - return - } - if _ret105 := _result104.GetSuccess(); _ret105 != nil { - return _ret105, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetTables failed: unknown result") + var _args102 TCLIServiceGetTablesArgs + _args102.Req = req + var _result104 TCLIServiceGetTablesResult + var _meta103 thrift.ResponseMeta + _meta103, _err = p.Client_().Call(ctx, "GetTables", &_args102, &_result104) + p.SetLastResponseMeta_(_meta103) + if _err != nil { + return + } + if _ret105 := _result104.GetSuccess(); _ret105 != nil { + return _ret105, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetTables failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetTableTypes(ctx context.Context, req *TGetTableTypesReq) (_r *TGetTableTypesResp, _err error) { - var _args106 TCLIServiceGetTableTypesArgs - _args106.Req = req - var _result108 TCLIServiceGetTableTypesResult - var _meta107 thrift.ResponseMeta - _meta107, _err = p.Client_().Call(ctx, "GetTableTypes", &_args106, &_result108) - p.SetLastResponseMeta_(_meta107) - if _err != nil { - return - } - if _ret109 := _result108.GetSuccess(); _ret109 != nil { - return _ret109, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetTableTypes failed: unknown result") + var _args106 TCLIServiceGetTableTypesArgs + _args106.Req = req + var _result108 TCLIServiceGetTableTypesResult + var _meta107 thrift.ResponseMeta + _meta107, _err = p.Client_().Call(ctx, "GetTableTypes", &_args106, &_result108) + p.SetLastResponseMeta_(_meta107) + if _err != nil { + return + } + if _ret109 := _result108.GetSuccess(); _ret109 != nil { + return _ret109, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetTableTypes failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetColumns(ctx context.Context, req *TGetColumnsReq) (_r *TGetColumnsResp, _err error) { - var _args110 TCLIServiceGetColumnsArgs - _args110.Req = req - var _result112 TCLIServiceGetColumnsResult - var _meta111 thrift.ResponseMeta - _meta111, _err = p.Client_().Call(ctx, "GetColumns", &_args110, &_result112) - p.SetLastResponseMeta_(_meta111) - if _err != nil { - return - } - if _ret113 := _result112.GetSuccess(); _ret113 != nil { - return _ret113, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetColumns failed: unknown result") + var _args110 TCLIServiceGetColumnsArgs + _args110.Req = req + var _result112 TCLIServiceGetColumnsResult + var _meta111 thrift.ResponseMeta + _meta111, _err = p.Client_().Call(ctx, "GetColumns", &_args110, &_result112) + p.SetLastResponseMeta_(_meta111) + if _err != nil { + return + } + if _ret113 := _result112.GetSuccess(); _ret113 != nil { + return _ret113, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetColumns failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetFunctions(ctx context.Context, req *TGetFunctionsReq) (_r *TGetFunctionsResp, _err error) { - var _args114 TCLIServiceGetFunctionsArgs - _args114.Req = req - var _result116 TCLIServiceGetFunctionsResult - var _meta115 thrift.ResponseMeta - _meta115, _err = p.Client_().Call(ctx, "GetFunctions", &_args114, &_result116) - p.SetLastResponseMeta_(_meta115) - if _err != nil { - return - } - if _ret117 := _result116.GetSuccess(); _ret117 != nil { - return _ret117, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetFunctions failed: unknown result") + var _args114 TCLIServiceGetFunctionsArgs + _args114.Req = req + var _result116 TCLIServiceGetFunctionsResult + var _meta115 thrift.ResponseMeta + _meta115, _err = p.Client_().Call(ctx, "GetFunctions", &_args114, &_result116) + p.SetLastResponseMeta_(_meta115) + if _err != nil { + return + } + if _ret117 := _result116.GetSuccess(); _ret117 != nil { + return _ret117, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetFunctions failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetPrimaryKeys(ctx context.Context, req *TGetPrimaryKeysReq) (_r *TGetPrimaryKeysResp, _err error) { - var _args118 TCLIServiceGetPrimaryKeysArgs - _args118.Req = req - var _result120 TCLIServiceGetPrimaryKeysResult - var _meta119 thrift.ResponseMeta - _meta119, _err = p.Client_().Call(ctx, "GetPrimaryKeys", &_args118, &_result120) - p.SetLastResponseMeta_(_meta119) - if _err != nil { - return - } - if _ret121 := _result120.GetSuccess(); _ret121 != nil { - return _ret121, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetPrimaryKeys failed: unknown result") + var _args118 TCLIServiceGetPrimaryKeysArgs + _args118.Req = req + var _result120 TCLIServiceGetPrimaryKeysResult + var _meta119 thrift.ResponseMeta + _meta119, _err = p.Client_().Call(ctx, "GetPrimaryKeys", &_args118, &_result120) + p.SetLastResponseMeta_(_meta119) + if _err != nil { + return + } + if _ret121 := _result120.GetSuccess(); _ret121 != nil { + return _ret121, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetPrimaryKeys failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetCrossReference(ctx context.Context, req *TGetCrossReferenceReq) (_r *TGetCrossReferenceResp, _err error) { - var _args122 TCLIServiceGetCrossReferenceArgs - _args122.Req = req - var _result124 TCLIServiceGetCrossReferenceResult - var _meta123 thrift.ResponseMeta - _meta123, _err = p.Client_().Call(ctx, "GetCrossReference", &_args122, &_result124) - p.SetLastResponseMeta_(_meta123) - if _err != nil { - return - } - if _ret125 := _result124.GetSuccess(); _ret125 != nil { - return _ret125, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetCrossReference failed: unknown result") + var _args122 TCLIServiceGetCrossReferenceArgs + _args122.Req = req + var _result124 TCLIServiceGetCrossReferenceResult + var _meta123 thrift.ResponseMeta + _meta123, _err = p.Client_().Call(ctx, "GetCrossReference", &_args122, &_result124) + p.SetLastResponseMeta_(_meta123) + if _err != nil { + return + } + if _ret125 := _result124.GetSuccess(); _ret125 != nil { + return _ret125, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetCrossReference failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetOperationStatus(ctx context.Context, req *TGetOperationStatusReq) (_r *TGetOperationStatusResp, _err error) { - var _args126 TCLIServiceGetOperationStatusArgs - _args126.Req = req - var _result128 TCLIServiceGetOperationStatusResult - var _meta127 thrift.ResponseMeta - _meta127, _err = p.Client_().Call(ctx, "GetOperationStatus", &_args126, &_result128) - p.SetLastResponseMeta_(_meta127) - if _err != nil { - return - } - if _ret129 := _result128.GetSuccess(); _ret129 != nil { - return _ret129, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetOperationStatus failed: unknown result") + var _args126 TCLIServiceGetOperationStatusArgs + _args126.Req = req + var _result128 TCLIServiceGetOperationStatusResult + var _meta127 thrift.ResponseMeta + _meta127, _err = p.Client_().Call(ctx, "GetOperationStatus", &_args126, &_result128) + p.SetLastResponseMeta_(_meta127) + if _err != nil { + return + } + if _ret129 := _result128.GetSuccess(); _ret129 != nil { + return _ret129, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetOperationStatus failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) CancelOperation(ctx context.Context, req *TCancelOperationReq) (_r *TCancelOperationResp, _err error) { - var _args130 TCLIServiceCancelOperationArgs - _args130.Req = req - var _result132 TCLIServiceCancelOperationResult - var _meta131 thrift.ResponseMeta - _meta131, _err = p.Client_().Call(ctx, "CancelOperation", &_args130, &_result132) - p.SetLastResponseMeta_(_meta131) - if _err != nil { - return - } - if _ret133 := _result132.GetSuccess(); _ret133 != nil { - return _ret133, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CancelOperation failed: unknown result") + var _args130 TCLIServiceCancelOperationArgs + _args130.Req = req + var _result132 TCLIServiceCancelOperationResult + var _meta131 thrift.ResponseMeta + _meta131, _err = p.Client_().Call(ctx, "CancelOperation", &_args130, &_result132) + p.SetLastResponseMeta_(_meta131) + if _err != nil { + return + } + if _ret133 := _result132.GetSuccess(); _ret133 != nil { + return _ret133, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CancelOperation failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) CloseOperation(ctx context.Context, req *TCloseOperationReq) (_r *TCloseOperationResp, _err error) { - var _args134 TCLIServiceCloseOperationArgs - _args134.Req = req - var _result136 TCLIServiceCloseOperationResult - var _meta135 thrift.ResponseMeta - _meta135, _err = p.Client_().Call(ctx, "CloseOperation", &_args134, &_result136) - p.SetLastResponseMeta_(_meta135) - if _err != nil { - return - } - if _ret137 := _result136.GetSuccess(); _ret137 != nil { - return _ret137, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CloseOperation failed: unknown result") + var _args134 TCLIServiceCloseOperationArgs + _args134.Req = req + var _result136 TCLIServiceCloseOperationResult + var _meta135 thrift.ResponseMeta + _meta135, _err = p.Client_().Call(ctx, "CloseOperation", &_args134, &_result136) + p.SetLastResponseMeta_(_meta135) + if _err != nil { + return + } + if _ret137 := _result136.GetSuccess(); _ret137 != nil { + return _ret137, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CloseOperation failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetResultSetMetadata(ctx context.Context, req *TGetResultSetMetadataReq) (_r *TGetResultSetMetadataResp, _err error) { - var _args138 TCLIServiceGetResultSetMetadataArgs - _args138.Req = req - var _result140 TCLIServiceGetResultSetMetadataResult - var _meta139 thrift.ResponseMeta - _meta139, _err = p.Client_().Call(ctx, "GetResultSetMetadata", &_args138, &_result140) - p.SetLastResponseMeta_(_meta139) - if _err != nil { - return - } - if _ret141 := _result140.GetSuccess(); _ret141 != nil { - return _ret141, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetResultSetMetadata failed: unknown result") + var _args138 TCLIServiceGetResultSetMetadataArgs + _args138.Req = req + var _result140 TCLIServiceGetResultSetMetadataResult + var _meta139 thrift.ResponseMeta + _meta139, _err = p.Client_().Call(ctx, "GetResultSetMetadata", &_args138, &_result140) + p.SetLastResponseMeta_(_meta139) + if _err != nil { + return + } + if _ret141 := _result140.GetSuccess(); _ret141 != nil { + return _ret141, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetResultSetMetadata failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) FetchResults(ctx context.Context, req *TFetchResultsReq) (_r *TFetchResultsResp, _err error) { - var _args142 TCLIServiceFetchResultsArgs - _args142.Req = req - var _result144 TCLIServiceFetchResultsResult - var _meta143 thrift.ResponseMeta - _meta143, _err = p.Client_().Call(ctx, "FetchResults", &_args142, &_result144) - p.SetLastResponseMeta_(_meta143) - if _err != nil { - return - } - if _ret145 := _result144.GetSuccess(); _ret145 != nil { - return _ret145, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "FetchResults failed: unknown result") + var _args142 TCLIServiceFetchResultsArgs + _args142.Req = req + var _result144 TCLIServiceFetchResultsResult + var _meta143 thrift.ResponseMeta + _meta143, _err = p.Client_().Call(ctx, "FetchResults", &_args142, &_result144) + p.SetLastResponseMeta_(_meta143) + if _err != nil { + return + } + if _ret145 := _result144.GetSuccess(); _ret145 != nil { + return _ret145, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "FetchResults failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetDelegationToken(ctx context.Context, req *TGetDelegationTokenReq) (_r *TGetDelegationTokenResp, _err error) { - var _args146 TCLIServiceGetDelegationTokenArgs - _args146.Req = req - var _result148 TCLIServiceGetDelegationTokenResult - var _meta147 thrift.ResponseMeta - _meta147, _err = p.Client_().Call(ctx, "GetDelegationToken", &_args146, &_result148) - p.SetLastResponseMeta_(_meta147) - if _err != nil { - return - } - if _ret149 := _result148.GetSuccess(); _ret149 != nil { - return _ret149, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetDelegationToken failed: unknown result") + var _args146 TCLIServiceGetDelegationTokenArgs + _args146.Req = req + var _result148 TCLIServiceGetDelegationTokenResult + var _meta147 thrift.ResponseMeta + _meta147, _err = p.Client_().Call(ctx, "GetDelegationToken", &_args146, &_result148) + p.SetLastResponseMeta_(_meta147) + if _err != nil { + return + } + if _ret149 := _result148.GetSuccess(); _ret149 != nil { + return _ret149, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetDelegationToken failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) CancelDelegationToken(ctx context.Context, req *TCancelDelegationTokenReq) (_r *TCancelDelegationTokenResp, _err error) { - var _args150 TCLIServiceCancelDelegationTokenArgs - _args150.Req = req - var _result152 TCLIServiceCancelDelegationTokenResult - var _meta151 thrift.ResponseMeta - _meta151, _err = p.Client_().Call(ctx, "CancelDelegationToken", &_args150, &_result152) - p.SetLastResponseMeta_(_meta151) - if _err != nil { - return - } - if _ret153 := _result152.GetSuccess(); _ret153 != nil { - return _ret153, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CancelDelegationToken failed: unknown result") + var _args150 TCLIServiceCancelDelegationTokenArgs + _args150.Req = req + var _result152 TCLIServiceCancelDelegationTokenResult + var _meta151 thrift.ResponseMeta + _meta151, _err = p.Client_().Call(ctx, "CancelDelegationToken", &_args150, &_result152) + p.SetLastResponseMeta_(_meta151) + if _err != nil { + return + } + if _ret153 := _result152.GetSuccess(); _ret153 != nil { + return _ret153, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CancelDelegationToken failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) RenewDelegationToken(ctx context.Context, req *TRenewDelegationTokenReq) (_r *TRenewDelegationTokenResp, _err error) { - var _args154 TCLIServiceRenewDelegationTokenArgs - _args154.Req = req - var _result156 TCLIServiceRenewDelegationTokenResult - var _meta155 thrift.ResponseMeta - _meta155, _err = p.Client_().Call(ctx, "RenewDelegationToken", &_args154, &_result156) - p.SetLastResponseMeta_(_meta155) - if _err != nil { - return - } - if _ret157 := _result156.GetSuccess(); _ret157 != nil { - return _ret157, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "RenewDelegationToken failed: unknown result") + var _args154 TCLIServiceRenewDelegationTokenArgs + _args154.Req = req + var _result156 TCLIServiceRenewDelegationTokenResult + var _meta155 thrift.ResponseMeta + _meta155, _err = p.Client_().Call(ctx, "RenewDelegationToken", &_args154, &_result156) + p.SetLastResponseMeta_(_meta155) + if _err != nil { + return + } + if _ret157 := _result156.GetSuccess(); _ret157 != nil { + return _ret157, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "RenewDelegationToken failed: unknown result") } type TCLIServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler TCLIService + processorMap map[string]thrift.TProcessorFunction + handler TCLIService } func (p *TCLIServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor + p.processorMap[key] = processor } func (p *TCLIServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok + processor, ok = p.processorMap[key] + return processor, ok } func (p *TCLIServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap + return p.processorMap } func NewTCLIServiceProcessor(handler TCLIService) *TCLIServiceProcessor { - self158 := &TCLIServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self158.processorMap["OpenSession"] = &tCLIServiceProcessorOpenSession{handler:handler} - self158.processorMap["CloseSession"] = &tCLIServiceProcessorCloseSession{handler:handler} - self158.processorMap["GetInfo"] = &tCLIServiceProcessorGetInfo{handler:handler} - self158.processorMap["ExecuteStatement"] = &tCLIServiceProcessorExecuteStatement{handler:handler} - self158.processorMap["GetTypeInfo"] = &tCLIServiceProcessorGetTypeInfo{handler:handler} - self158.processorMap["GetCatalogs"] = &tCLIServiceProcessorGetCatalogs{handler:handler} - self158.processorMap["GetSchemas"] = &tCLIServiceProcessorGetSchemas{handler:handler} - self158.processorMap["GetTables"] = &tCLIServiceProcessorGetTables{handler:handler} - self158.processorMap["GetTableTypes"] = &tCLIServiceProcessorGetTableTypes{handler:handler} - self158.processorMap["GetColumns"] = &tCLIServiceProcessorGetColumns{handler:handler} - self158.processorMap["GetFunctions"] = &tCLIServiceProcessorGetFunctions{handler:handler} - self158.processorMap["GetPrimaryKeys"] = &tCLIServiceProcessorGetPrimaryKeys{handler:handler} - self158.processorMap["GetCrossReference"] = &tCLIServiceProcessorGetCrossReference{handler:handler} - self158.processorMap["GetOperationStatus"] = &tCLIServiceProcessorGetOperationStatus{handler:handler} - self158.processorMap["CancelOperation"] = &tCLIServiceProcessorCancelOperation{handler:handler} - self158.processorMap["CloseOperation"] = &tCLIServiceProcessorCloseOperation{handler:handler} - self158.processorMap["GetResultSetMetadata"] = &tCLIServiceProcessorGetResultSetMetadata{handler:handler} - self158.processorMap["FetchResults"] = &tCLIServiceProcessorFetchResults{handler:handler} - self158.processorMap["GetDelegationToken"] = &tCLIServiceProcessorGetDelegationToken{handler:handler} - self158.processorMap["CancelDelegationToken"] = &tCLIServiceProcessorCancelDelegationToken{handler:handler} - self158.processorMap["RenewDelegationToken"] = &tCLIServiceProcessorRenewDelegationToken{handler:handler} -return self158 + self158 := &TCLIServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self158.processorMap["OpenSession"] = &tCLIServiceProcessorOpenSession{handler: handler} + self158.processorMap["CloseSession"] = &tCLIServiceProcessorCloseSession{handler: handler} + self158.processorMap["GetInfo"] = &tCLIServiceProcessorGetInfo{handler: handler} + self158.processorMap["ExecuteStatement"] = &tCLIServiceProcessorExecuteStatement{handler: handler} + self158.processorMap["GetTypeInfo"] = &tCLIServiceProcessorGetTypeInfo{handler: handler} + self158.processorMap["GetCatalogs"] = &tCLIServiceProcessorGetCatalogs{handler: handler} + self158.processorMap["GetSchemas"] = &tCLIServiceProcessorGetSchemas{handler: handler} + self158.processorMap["GetTables"] = &tCLIServiceProcessorGetTables{handler: handler} + self158.processorMap["GetTableTypes"] = &tCLIServiceProcessorGetTableTypes{handler: handler} + self158.processorMap["GetColumns"] = &tCLIServiceProcessorGetColumns{handler: handler} + self158.processorMap["GetFunctions"] = &tCLIServiceProcessorGetFunctions{handler: handler} + self158.processorMap["GetPrimaryKeys"] = &tCLIServiceProcessorGetPrimaryKeys{handler: handler} + self158.processorMap["GetCrossReference"] = &tCLIServiceProcessorGetCrossReference{handler: handler} + self158.processorMap["GetOperationStatus"] = &tCLIServiceProcessorGetOperationStatus{handler: handler} + self158.processorMap["CancelOperation"] = &tCLIServiceProcessorCancelOperation{handler: handler} + self158.processorMap["CloseOperation"] = &tCLIServiceProcessorCloseOperation{handler: handler} + self158.processorMap["GetResultSetMetadata"] = &tCLIServiceProcessorGetResultSetMetadata{handler: handler} + self158.processorMap["FetchResults"] = &tCLIServiceProcessorFetchResults{handler: handler} + self158.processorMap["GetDelegationToken"] = &tCLIServiceProcessorGetDelegationToken{handler: handler} + self158.processorMap["CancelDelegationToken"] = &tCLIServiceProcessorCancelDelegationToken{handler: handler} + self158.processorMap["RenewDelegationToken"] = &tCLIServiceProcessorRenewDelegationToken{handler: handler} + return self158 } func (p *TCLIServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) - if err2 != nil { return false, thrift.WrapTException(err2) } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(ctx, thrift.STRUCT) - iprot.ReadMessageEnd(ctx) - x159 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) - oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) - x159.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, x159 + name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) + if err2 != nil { + return false, thrift.WrapTException(err2) + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(ctx, thrift.STRUCT) + iprot.ReadMessageEnd(ctx) + x159 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x159.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, x159 } type tCLIServiceProcessorOpenSession struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorOpenSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err160 error - args := TCLIServiceOpenSessionArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "OpenSession", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceOpenSessionResult{} - if retval, err2 := p.handler.OpenSession(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc161 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing OpenSession: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "OpenSession", thrift.EXCEPTION, seqId); err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if err2 := _exc161.Write(ctx, oprot); _write_err160 == nil && err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err160 == nil && err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err160 == nil && err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if _write_err160 != nil { - return false, thrift.WrapTException(_write_err160) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "OpenSession", thrift.REPLY, seqId); err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err160 == nil && err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err160 == nil && err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err160 == nil && err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if _write_err160 != nil { - return false, thrift.WrapTException(_write_err160) - } - return true, err + var _write_err160 error + args := TCLIServiceOpenSessionArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "OpenSession", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceOpenSessionResult{} + if retval, err2 := p.handler.OpenSession(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc161 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing OpenSession: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "OpenSession", thrift.EXCEPTION, seqId); err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if err2 := _exc161.Write(ctx, oprot); _write_err160 == nil && err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err160 == nil && err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err160 == nil && err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if _write_err160 != nil { + return false, thrift.WrapTException(_write_err160) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "OpenSession", thrift.REPLY, seqId); err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err160 == nil && err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err160 == nil && err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err160 == nil && err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if _write_err160 != nil { + return false, thrift.WrapTException(_write_err160) + } + return true, err } type tCLIServiceProcessorCloseSession struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorCloseSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err162 error - args := TCLIServiceCloseSessionArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "CloseSession", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceCloseSessionResult{} - if retval, err2 := p.handler.CloseSession(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc163 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseSession: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "CloseSession", thrift.EXCEPTION, seqId); err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if err2 := _exc163.Write(ctx, oprot); _write_err162 == nil && err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err162 == nil && err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err162 == nil && err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if _write_err162 != nil { - return false, thrift.WrapTException(_write_err162) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "CloseSession", thrift.REPLY, seqId); err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err162 == nil && err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err162 == nil && err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err162 == nil && err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if _write_err162 != nil { - return false, thrift.WrapTException(_write_err162) - } - return true, err + var _write_err162 error + args := TCLIServiceCloseSessionArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "CloseSession", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceCloseSessionResult{} + if retval, err2 := p.handler.CloseSession(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc163 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseSession: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "CloseSession", thrift.EXCEPTION, seqId); err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if err2 := _exc163.Write(ctx, oprot); _write_err162 == nil && err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err162 == nil && err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err162 == nil && err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if _write_err162 != nil { + return false, thrift.WrapTException(_write_err162) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "CloseSession", thrift.REPLY, seqId); err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err162 == nil && err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err162 == nil && err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err162 == nil && err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if _write_err162 != nil { + return false, thrift.WrapTException(_write_err162) + } + return true, err } type tCLIServiceProcessorGetInfo struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err164 error - args := TCLIServiceGetInfoArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetInfo", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetInfoResult{} - if retval, err2 := p.handler.GetInfo(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc165 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetInfo: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetInfo", thrift.EXCEPTION, seqId); err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if err2 := _exc165.Write(ctx, oprot); _write_err164 == nil && err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err164 == nil && err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err164 == nil && err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if _write_err164 != nil { - return false, thrift.WrapTException(_write_err164) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetInfo", thrift.REPLY, seqId); err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err164 == nil && err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err164 == nil && err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err164 == nil && err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if _write_err164 != nil { - return false, thrift.WrapTException(_write_err164) - } - return true, err + var _write_err164 error + args := TCLIServiceGetInfoArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetInfo", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetInfoResult{} + if retval, err2 := p.handler.GetInfo(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc165 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetInfo: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetInfo", thrift.EXCEPTION, seqId); err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if err2 := _exc165.Write(ctx, oprot); _write_err164 == nil && err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err164 == nil && err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err164 == nil && err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if _write_err164 != nil { + return false, thrift.WrapTException(_write_err164) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetInfo", thrift.REPLY, seqId); err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err164 == nil && err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err164 == nil && err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err164 == nil && err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if _write_err164 != nil { + return false, thrift.WrapTException(_write_err164) + } + return true, err } type tCLIServiceProcessorExecuteStatement struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorExecuteStatement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err166 error - args := TCLIServiceExecuteStatementArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceExecuteStatementResult{} - if retval, err2 := p.handler.ExecuteStatement(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc167 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExecuteStatement: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.EXCEPTION, seqId); err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if err2 := _exc167.Write(ctx, oprot); _write_err166 == nil && err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err166 == nil && err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err166 == nil && err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if _write_err166 != nil { - return false, thrift.WrapTException(_write_err166) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.REPLY, seqId); err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err166 == nil && err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err166 == nil && err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err166 == nil && err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if _write_err166 != nil { - return false, thrift.WrapTException(_write_err166) - } - return true, err + var _write_err166 error + args := TCLIServiceExecuteStatementArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceExecuteStatementResult{} + if retval, err2 := p.handler.ExecuteStatement(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc167 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExecuteStatement: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.EXCEPTION, seqId); err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if err2 := _exc167.Write(ctx, oprot); _write_err166 == nil && err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err166 == nil && err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err166 == nil && err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if _write_err166 != nil { + return false, thrift.WrapTException(_write_err166) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.REPLY, seqId); err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err166 == nil && err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err166 == nil && err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err166 == nil && err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if _write_err166 != nil { + return false, thrift.WrapTException(_write_err166) + } + return true, err } type tCLIServiceProcessorGetTypeInfo struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetTypeInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err168 error - args := TCLIServiceGetTypeInfoArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetTypeInfoResult{} - if retval, err2 := p.handler.GetTypeInfo(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc169 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTypeInfo: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.EXCEPTION, seqId); err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if err2 := _exc169.Write(ctx, oprot); _write_err168 == nil && err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err168 == nil && err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err168 == nil && err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if _write_err168 != nil { - return false, thrift.WrapTException(_write_err168) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.REPLY, seqId); err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err168 == nil && err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err168 == nil && err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err168 == nil && err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if _write_err168 != nil { - return false, thrift.WrapTException(_write_err168) - } - return true, err + var _write_err168 error + args := TCLIServiceGetTypeInfoArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetTypeInfoResult{} + if retval, err2 := p.handler.GetTypeInfo(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc169 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTypeInfo: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.EXCEPTION, seqId); err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if err2 := _exc169.Write(ctx, oprot); _write_err168 == nil && err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err168 == nil && err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err168 == nil && err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if _write_err168 != nil { + return false, thrift.WrapTException(_write_err168) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.REPLY, seqId); err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err168 == nil && err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err168 == nil && err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err168 == nil && err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if _write_err168 != nil { + return false, thrift.WrapTException(_write_err168) + } + return true, err } type tCLIServiceProcessorGetCatalogs struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetCatalogs) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err170 error - args := TCLIServiceGetCatalogsArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetCatalogsResult{} - if retval, err2 := p.handler.GetCatalogs(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc171 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCatalogs: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.EXCEPTION, seqId); err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if err2 := _exc171.Write(ctx, oprot); _write_err170 == nil && err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err170 == nil && err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err170 == nil && err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if _write_err170 != nil { - return false, thrift.WrapTException(_write_err170) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.REPLY, seqId); err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err170 == nil && err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err170 == nil && err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err170 == nil && err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if _write_err170 != nil { - return false, thrift.WrapTException(_write_err170) - } - return true, err + var _write_err170 error + args := TCLIServiceGetCatalogsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetCatalogsResult{} + if retval, err2 := p.handler.GetCatalogs(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc171 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCatalogs: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.EXCEPTION, seqId); err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if err2 := _exc171.Write(ctx, oprot); _write_err170 == nil && err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err170 == nil && err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err170 == nil && err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if _write_err170 != nil { + return false, thrift.WrapTException(_write_err170) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.REPLY, seqId); err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err170 == nil && err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err170 == nil && err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err170 == nil && err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if _write_err170 != nil { + return false, thrift.WrapTException(_write_err170) + } + return true, err } type tCLIServiceProcessorGetSchemas struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetSchemas) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err172 error - args := TCLIServiceGetSchemasArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetSchemasResult{} - if retval, err2 := p.handler.GetSchemas(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc173 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetSchemas: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.EXCEPTION, seqId); err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if err2 := _exc173.Write(ctx, oprot); _write_err172 == nil && err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err172 == nil && err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err172 == nil && err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if _write_err172 != nil { - return false, thrift.WrapTException(_write_err172) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.REPLY, seqId); err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err172 == nil && err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err172 == nil && err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err172 == nil && err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if _write_err172 != nil { - return false, thrift.WrapTException(_write_err172) - } - return true, err + var _write_err172 error + args := TCLIServiceGetSchemasArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetSchemasResult{} + if retval, err2 := p.handler.GetSchemas(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc173 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetSchemas: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.EXCEPTION, seqId); err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if err2 := _exc173.Write(ctx, oprot); _write_err172 == nil && err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err172 == nil && err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err172 == nil && err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if _write_err172 != nil { + return false, thrift.WrapTException(_write_err172) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.REPLY, seqId); err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err172 == nil && err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err172 == nil && err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err172 == nil && err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if _write_err172 != nil { + return false, thrift.WrapTException(_write_err172) + } + return true, err } type tCLIServiceProcessorGetTables struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetTables) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err174 error - args := TCLIServiceGetTablesArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetTables", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetTablesResult{} - if retval, err2 := p.handler.GetTables(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc175 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTables: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetTables", thrift.EXCEPTION, seqId); err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if err2 := _exc175.Write(ctx, oprot); _write_err174 == nil && err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err174 == nil && err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err174 == nil && err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if _write_err174 != nil { - return false, thrift.WrapTException(_write_err174) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetTables", thrift.REPLY, seqId); err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err174 == nil && err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err174 == nil && err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err174 == nil && err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if _write_err174 != nil { - return false, thrift.WrapTException(_write_err174) - } - return true, err + var _write_err174 error + args := TCLIServiceGetTablesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetTables", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetTablesResult{} + if retval, err2 := p.handler.GetTables(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc175 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTables: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetTables", thrift.EXCEPTION, seqId); err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if err2 := _exc175.Write(ctx, oprot); _write_err174 == nil && err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err174 == nil && err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err174 == nil && err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if _write_err174 != nil { + return false, thrift.WrapTException(_write_err174) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetTables", thrift.REPLY, seqId); err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err174 == nil && err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err174 == nil && err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err174 == nil && err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if _write_err174 != nil { + return false, thrift.WrapTException(_write_err174) + } + return true, err } type tCLIServiceProcessorGetTableTypes struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetTableTypes) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err176 error - args := TCLIServiceGetTableTypesArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetTableTypesResult{} - if retval, err2 := p.handler.GetTableTypes(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc177 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTableTypes: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.EXCEPTION, seqId); err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if err2 := _exc177.Write(ctx, oprot); _write_err176 == nil && err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err176 == nil && err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err176 == nil && err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if _write_err176 != nil { - return false, thrift.WrapTException(_write_err176) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.REPLY, seqId); err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err176 == nil && err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err176 == nil && err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err176 == nil && err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if _write_err176 != nil { - return false, thrift.WrapTException(_write_err176) - } - return true, err + var _write_err176 error + args := TCLIServiceGetTableTypesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetTableTypesResult{} + if retval, err2 := p.handler.GetTableTypes(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc177 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTableTypes: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.EXCEPTION, seqId); err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if err2 := _exc177.Write(ctx, oprot); _write_err176 == nil && err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err176 == nil && err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err176 == nil && err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if _write_err176 != nil { + return false, thrift.WrapTException(_write_err176) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.REPLY, seqId); err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err176 == nil && err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err176 == nil && err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err176 == nil && err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if _write_err176 != nil { + return false, thrift.WrapTException(_write_err176) + } + return true, err } type tCLIServiceProcessorGetColumns struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetColumns) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err178 error - args := TCLIServiceGetColumnsArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetColumns", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetColumnsResult{} - if retval, err2 := p.handler.GetColumns(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc179 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetColumns: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetColumns", thrift.EXCEPTION, seqId); err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if err2 := _exc179.Write(ctx, oprot); _write_err178 == nil && err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err178 == nil && err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err178 == nil && err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if _write_err178 != nil { - return false, thrift.WrapTException(_write_err178) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetColumns", thrift.REPLY, seqId); err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err178 == nil && err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err178 == nil && err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err178 == nil && err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if _write_err178 != nil { - return false, thrift.WrapTException(_write_err178) - } - return true, err + var _write_err178 error + args := TCLIServiceGetColumnsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetColumns", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetColumnsResult{} + if retval, err2 := p.handler.GetColumns(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc179 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetColumns: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetColumns", thrift.EXCEPTION, seqId); err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if err2 := _exc179.Write(ctx, oprot); _write_err178 == nil && err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err178 == nil && err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err178 == nil && err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if _write_err178 != nil { + return false, thrift.WrapTException(_write_err178) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetColumns", thrift.REPLY, seqId); err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err178 == nil && err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err178 == nil && err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err178 == nil && err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if _write_err178 != nil { + return false, thrift.WrapTException(_write_err178) + } + return true, err } type tCLIServiceProcessorGetFunctions struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetFunctions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err180 error - args := TCLIServiceGetFunctionsArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetFunctionsResult{} - if retval, err2 := p.handler.GetFunctions(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc181 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetFunctions: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.EXCEPTION, seqId); err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if err2 := _exc181.Write(ctx, oprot); _write_err180 == nil && err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err180 == nil && err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err180 == nil && err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if _write_err180 != nil { - return false, thrift.WrapTException(_write_err180) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.REPLY, seqId); err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err180 == nil && err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err180 == nil && err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err180 == nil && err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if _write_err180 != nil { - return false, thrift.WrapTException(_write_err180) - } - return true, err + var _write_err180 error + args := TCLIServiceGetFunctionsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetFunctionsResult{} + if retval, err2 := p.handler.GetFunctions(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc181 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetFunctions: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.EXCEPTION, seqId); err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if err2 := _exc181.Write(ctx, oprot); _write_err180 == nil && err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err180 == nil && err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err180 == nil && err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if _write_err180 != nil { + return false, thrift.WrapTException(_write_err180) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.REPLY, seqId); err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err180 == nil && err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err180 == nil && err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err180 == nil && err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if _write_err180 != nil { + return false, thrift.WrapTException(_write_err180) + } + return true, err } type tCLIServiceProcessorGetPrimaryKeys struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetPrimaryKeys) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err182 error - args := TCLIServiceGetPrimaryKeysArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetPrimaryKeysResult{} - if retval, err2 := p.handler.GetPrimaryKeys(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc183 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetPrimaryKeys: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.EXCEPTION, seqId); err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if err2 := _exc183.Write(ctx, oprot); _write_err182 == nil && err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err182 == nil && err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err182 == nil && err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if _write_err182 != nil { - return false, thrift.WrapTException(_write_err182) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.REPLY, seqId); err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err182 == nil && err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err182 == nil && err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err182 == nil && err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if _write_err182 != nil { - return false, thrift.WrapTException(_write_err182) - } - return true, err + var _write_err182 error + args := TCLIServiceGetPrimaryKeysArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetPrimaryKeysResult{} + if retval, err2 := p.handler.GetPrimaryKeys(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc183 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetPrimaryKeys: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.EXCEPTION, seqId); err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if err2 := _exc183.Write(ctx, oprot); _write_err182 == nil && err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err182 == nil && err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err182 == nil && err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if _write_err182 != nil { + return false, thrift.WrapTException(_write_err182) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.REPLY, seqId); err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err182 == nil && err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err182 == nil && err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err182 == nil && err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if _write_err182 != nil { + return false, thrift.WrapTException(_write_err182) + } + return true, err } type tCLIServiceProcessorGetCrossReference struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetCrossReference) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err184 error - args := TCLIServiceGetCrossReferenceArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetCrossReferenceResult{} - if retval, err2 := p.handler.GetCrossReference(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc185 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCrossReference: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.EXCEPTION, seqId); err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if err2 := _exc185.Write(ctx, oprot); _write_err184 == nil && err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err184 == nil && err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err184 == nil && err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if _write_err184 != nil { - return false, thrift.WrapTException(_write_err184) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.REPLY, seqId); err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err184 == nil && err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err184 == nil && err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err184 == nil && err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if _write_err184 != nil { - return false, thrift.WrapTException(_write_err184) - } - return true, err + var _write_err184 error + args := TCLIServiceGetCrossReferenceArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetCrossReferenceResult{} + if retval, err2 := p.handler.GetCrossReference(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc185 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCrossReference: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.EXCEPTION, seqId); err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if err2 := _exc185.Write(ctx, oprot); _write_err184 == nil && err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err184 == nil && err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err184 == nil && err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if _write_err184 != nil { + return false, thrift.WrapTException(_write_err184) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.REPLY, seqId); err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err184 == nil && err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err184 == nil && err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err184 == nil && err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if _write_err184 != nil { + return false, thrift.WrapTException(_write_err184) + } + return true, err } type tCLIServiceProcessorGetOperationStatus struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetOperationStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err186 error - args := TCLIServiceGetOperationStatusArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetOperationStatusResult{} - if retval, err2 := p.handler.GetOperationStatus(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc187 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetOperationStatus: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.EXCEPTION, seqId); err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if err2 := _exc187.Write(ctx, oprot); _write_err186 == nil && err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err186 == nil && err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err186 == nil && err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if _write_err186 != nil { - return false, thrift.WrapTException(_write_err186) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.REPLY, seqId); err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err186 == nil && err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err186 == nil && err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err186 == nil && err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if _write_err186 != nil { - return false, thrift.WrapTException(_write_err186) - } - return true, err + var _write_err186 error + args := TCLIServiceGetOperationStatusArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetOperationStatusResult{} + if retval, err2 := p.handler.GetOperationStatus(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc187 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetOperationStatus: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.EXCEPTION, seqId); err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if err2 := _exc187.Write(ctx, oprot); _write_err186 == nil && err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err186 == nil && err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err186 == nil && err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if _write_err186 != nil { + return false, thrift.WrapTException(_write_err186) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.REPLY, seqId); err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err186 == nil && err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err186 == nil && err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err186 == nil && err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if _write_err186 != nil { + return false, thrift.WrapTException(_write_err186) + } + return true, err } type tCLIServiceProcessorCancelOperation struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorCancelOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err188 error - args := TCLIServiceCancelOperationArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceCancelOperationResult{} - if retval, err2 := p.handler.CancelOperation(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc189 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelOperation: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.EXCEPTION, seqId); err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if err2 := _exc189.Write(ctx, oprot); _write_err188 == nil && err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err188 == nil && err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err188 == nil && err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if _write_err188 != nil { - return false, thrift.WrapTException(_write_err188) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.REPLY, seqId); err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err188 == nil && err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err188 == nil && err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err188 == nil && err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if _write_err188 != nil { - return false, thrift.WrapTException(_write_err188) - } - return true, err + var _write_err188 error + args := TCLIServiceCancelOperationArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceCancelOperationResult{} + if retval, err2 := p.handler.CancelOperation(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc189 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelOperation: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.EXCEPTION, seqId); err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if err2 := _exc189.Write(ctx, oprot); _write_err188 == nil && err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err188 == nil && err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err188 == nil && err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if _write_err188 != nil { + return false, thrift.WrapTException(_write_err188) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.REPLY, seqId); err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err188 == nil && err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err188 == nil && err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err188 == nil && err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if _write_err188 != nil { + return false, thrift.WrapTException(_write_err188) + } + return true, err } type tCLIServiceProcessorCloseOperation struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorCloseOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err190 error - args := TCLIServiceCloseOperationArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceCloseOperationResult{} - if retval, err2 := p.handler.CloseOperation(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc191 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseOperation: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.EXCEPTION, seqId); err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if err2 := _exc191.Write(ctx, oprot); _write_err190 == nil && err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err190 == nil && err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err190 == nil && err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if _write_err190 != nil { - return false, thrift.WrapTException(_write_err190) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.REPLY, seqId); err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err190 == nil && err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err190 == nil && err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err190 == nil && err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if _write_err190 != nil { - return false, thrift.WrapTException(_write_err190) - } - return true, err + var _write_err190 error + args := TCLIServiceCloseOperationArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceCloseOperationResult{} + if retval, err2 := p.handler.CloseOperation(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc191 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseOperation: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.EXCEPTION, seqId); err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if err2 := _exc191.Write(ctx, oprot); _write_err190 == nil && err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err190 == nil && err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err190 == nil && err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if _write_err190 != nil { + return false, thrift.WrapTException(_write_err190) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.REPLY, seqId); err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err190 == nil && err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err190 == nil && err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err190 == nil && err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if _write_err190 != nil { + return false, thrift.WrapTException(_write_err190) + } + return true, err } type tCLIServiceProcessorGetResultSetMetadata struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetResultSetMetadata) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err192 error - args := TCLIServiceGetResultSetMetadataArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetResultSetMetadataResult{} - if retval, err2 := p.handler.GetResultSetMetadata(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc193 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetResultSetMetadata: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.EXCEPTION, seqId); err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if err2 := _exc193.Write(ctx, oprot); _write_err192 == nil && err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err192 == nil && err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err192 == nil && err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if _write_err192 != nil { - return false, thrift.WrapTException(_write_err192) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.REPLY, seqId); err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err192 == nil && err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err192 == nil && err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err192 == nil && err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if _write_err192 != nil { - return false, thrift.WrapTException(_write_err192) - } - return true, err + var _write_err192 error + args := TCLIServiceGetResultSetMetadataArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetResultSetMetadataResult{} + if retval, err2 := p.handler.GetResultSetMetadata(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc193 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetResultSetMetadata: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.EXCEPTION, seqId); err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if err2 := _exc193.Write(ctx, oprot); _write_err192 == nil && err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err192 == nil && err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err192 == nil && err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if _write_err192 != nil { + return false, thrift.WrapTException(_write_err192) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.REPLY, seqId); err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err192 == nil && err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err192 == nil && err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err192 == nil && err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if _write_err192 != nil { + return false, thrift.WrapTException(_write_err192) + } + return true, err } type tCLIServiceProcessorFetchResults struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorFetchResults) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err194 error - args := TCLIServiceFetchResultsArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "FetchResults", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceFetchResultsResult{} - if retval, err2 := p.handler.FetchResults(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc195 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing FetchResults: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "FetchResults", thrift.EXCEPTION, seqId); err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if err2 := _exc195.Write(ctx, oprot); _write_err194 == nil && err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err194 == nil && err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err194 == nil && err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if _write_err194 != nil { - return false, thrift.WrapTException(_write_err194) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "FetchResults", thrift.REPLY, seqId); err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err194 == nil && err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err194 == nil && err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err194 == nil && err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if _write_err194 != nil { - return false, thrift.WrapTException(_write_err194) - } - return true, err + var _write_err194 error + args := TCLIServiceFetchResultsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "FetchResults", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceFetchResultsResult{} + if retval, err2 := p.handler.FetchResults(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc195 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing FetchResults: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "FetchResults", thrift.EXCEPTION, seqId); err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if err2 := _exc195.Write(ctx, oprot); _write_err194 == nil && err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err194 == nil && err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err194 == nil && err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if _write_err194 != nil { + return false, thrift.WrapTException(_write_err194) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "FetchResults", thrift.REPLY, seqId); err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err194 == nil && err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err194 == nil && err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err194 == nil && err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if _write_err194 != nil { + return false, thrift.WrapTException(_write_err194) + } + return true, err } type tCLIServiceProcessorGetDelegationToken struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err196 error - args := TCLIServiceGetDelegationTokenArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetDelegationTokenResult{} - if retval, err2 := p.handler.GetDelegationToken(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc197 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDelegationToken: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.EXCEPTION, seqId); err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if err2 := _exc197.Write(ctx, oprot); _write_err196 == nil && err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err196 == nil && err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err196 == nil && err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if _write_err196 != nil { - return false, thrift.WrapTException(_write_err196) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.REPLY, seqId); err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err196 == nil && err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err196 == nil && err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err196 == nil && err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if _write_err196 != nil { - return false, thrift.WrapTException(_write_err196) - } - return true, err + var _write_err196 error + args := TCLIServiceGetDelegationTokenArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetDelegationTokenResult{} + if retval, err2 := p.handler.GetDelegationToken(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc197 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDelegationToken: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.EXCEPTION, seqId); err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if err2 := _exc197.Write(ctx, oprot); _write_err196 == nil && err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err196 == nil && err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err196 == nil && err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if _write_err196 != nil { + return false, thrift.WrapTException(_write_err196) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.REPLY, seqId); err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err196 == nil && err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err196 == nil && err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err196 == nil && err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if _write_err196 != nil { + return false, thrift.WrapTException(_write_err196) + } + return true, err } type tCLIServiceProcessorCancelDelegationToken struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorCancelDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err198 error - args := TCLIServiceCancelDelegationTokenArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceCancelDelegationTokenResult{} - if retval, err2 := p.handler.CancelDelegationToken(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc199 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelDelegationToken: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.EXCEPTION, seqId); err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if err2 := _exc199.Write(ctx, oprot); _write_err198 == nil && err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err198 == nil && err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err198 == nil && err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if _write_err198 != nil { - return false, thrift.WrapTException(_write_err198) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.REPLY, seqId); err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err198 == nil && err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err198 == nil && err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err198 == nil && err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if _write_err198 != nil { - return false, thrift.WrapTException(_write_err198) - } - return true, err + var _write_err198 error + args := TCLIServiceCancelDelegationTokenArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceCancelDelegationTokenResult{} + if retval, err2 := p.handler.CancelDelegationToken(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc199 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelDelegationToken: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.EXCEPTION, seqId); err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if err2 := _exc199.Write(ctx, oprot); _write_err198 == nil && err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err198 == nil && err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err198 == nil && err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if _write_err198 != nil { + return false, thrift.WrapTException(_write_err198) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.REPLY, seqId); err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err198 == nil && err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err198 == nil && err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err198 == nil && err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if _write_err198 != nil { + return false, thrift.WrapTException(_write_err198) + } + return true, err } type tCLIServiceProcessorRenewDelegationToken struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorRenewDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err200 error - args := TCLIServiceRenewDelegationTokenArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceRenewDelegationTokenResult{} - if retval, err2 := p.handler.RenewDelegationToken(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc201 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RenewDelegationToken: " + err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.EXCEPTION, seqId); err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if err2 := _exc201.Write(ctx, oprot); _write_err200 == nil && err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err200 == nil && err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err200 == nil && err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if _write_err200 != nil { - return false, thrift.WrapTException(_write_err200) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.REPLY, seqId); err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err200 == nil && err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err200 == nil && err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err200 == nil && err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if _write_err200 != nil { - return false, thrift.WrapTException(_write_err200) - } - return true, err + var _write_err200 error + args := TCLIServiceRenewDelegationTokenArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceRenewDelegationTokenResult{} + if retval, err2 := p.handler.RenewDelegationToken(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc201 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RenewDelegationToken: "+err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.EXCEPTION, seqId); err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if err2 := _exc201.Write(ctx, oprot); _write_err200 == nil && err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err200 == nil && err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err200 == nil && err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if _write_err200 != nil { + return false, thrift.WrapTException(_write_err200) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.REPLY, seqId); err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err200 == nil && err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err200 == nil && err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err200 == nil && err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if _write_err200 != nil { + return false, thrift.WrapTException(_write_err200) + } + return true, err } - // HELPER FUNCTIONS AND STRUCTURES // Attributes: -// - Req +// - Req type TCLIServiceOpenSessionArgs struct { - Req *TOpenSessionReq `thrift:"req,1" db:"req" json:"req"` + Req *TOpenSessionReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceOpenSessionArgs() *TCLIServiceOpenSessionArgs { - return &TCLIServiceOpenSessionArgs{} + return &TCLIServiceOpenSessionArgs{} } var TCLIServiceOpenSessionArgs_Req_DEFAULT *TOpenSessionReq + func (p *TCLIServiceOpenSessionArgs) GetReq() *TOpenSessionReq { - if !p.IsSetReq() { - return TCLIServiceOpenSessionArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceOpenSessionArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceOpenSessionArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceOpenSessionArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceOpenSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TOpenSessionReq{ - ClientProtocol: -7, -} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceOpenSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TOpenSessionReq{ + ClientProtocol: -7, + } + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceOpenSessionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "OpenSession_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "OpenSession_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceOpenSessionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceOpenSessionArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceOpenSessionArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceOpenSessionArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceOpenSessionResult struct { - Success *TOpenSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TOpenSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceOpenSessionResult() *TCLIServiceOpenSessionResult { - return &TCLIServiceOpenSessionResult{} + return &TCLIServiceOpenSessionResult{} } var TCLIServiceOpenSessionResult_Success_DEFAULT *TOpenSessionResp + func (p *TCLIServiceOpenSessionResult) GetSuccess() *TOpenSessionResp { - if !p.IsSetSuccess() { - return TCLIServiceOpenSessionResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceOpenSessionResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceOpenSessionResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceOpenSessionResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceOpenSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TOpenSessionResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceOpenSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TOpenSessionResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceOpenSessionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "OpenSession_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "OpenSession_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceOpenSessionResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceOpenSessionResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceOpenSessionResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceOpenSessionResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceCloseSessionArgs struct { - Req *TCloseSessionReq `thrift:"req,1" db:"req" json:"req"` + Req *TCloseSessionReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceCloseSessionArgs() *TCLIServiceCloseSessionArgs { - return &TCLIServiceCloseSessionArgs{} + return &TCLIServiceCloseSessionArgs{} } var TCLIServiceCloseSessionArgs_Req_DEFAULT *TCloseSessionReq + func (p *TCLIServiceCloseSessionArgs) GetReq() *TCloseSessionReq { - if !p.IsSetReq() { - return TCLIServiceCloseSessionArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceCloseSessionArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceCloseSessionArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceCloseSessionArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCloseSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TCloseSessionReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCloseSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TCloseSessionReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceCloseSessionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CloseSession_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "CloseSession_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceCloseSessionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceCloseSessionArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCloseSessionArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCloseSessionArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceCloseSessionResult struct { - Success *TCloseSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TCloseSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceCloseSessionResult() *TCLIServiceCloseSessionResult { - return &TCLIServiceCloseSessionResult{} + return &TCLIServiceCloseSessionResult{} } var TCLIServiceCloseSessionResult_Success_DEFAULT *TCloseSessionResp + func (p *TCLIServiceCloseSessionResult) GetSuccess() *TCloseSessionResp { - if !p.IsSetSuccess() { - return TCLIServiceCloseSessionResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceCloseSessionResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceCloseSessionResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceCloseSessionResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCloseSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TCloseSessionResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCloseSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TCloseSessionResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceCloseSessionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CloseSession_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "CloseSession_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceCloseSessionResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceCloseSessionResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCloseSessionResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCloseSessionResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetInfoArgs struct { - Req *TGetInfoReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetInfoReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetInfoArgs() *TCLIServiceGetInfoArgs { - return &TCLIServiceGetInfoArgs{} + return &TCLIServiceGetInfoArgs{} } var TCLIServiceGetInfoArgs_Req_DEFAULT *TGetInfoReq + func (p *TCLIServiceGetInfoArgs) GetReq() *TGetInfoReq { - if !p.IsSetReq() { - return TCLIServiceGetInfoArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetInfoArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetInfoArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetInfoArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetInfoReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetInfoReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetInfoArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetInfo_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetInfo_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetInfoArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceGetInfoArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetInfoArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetInfoArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetInfoResult struct { - Success *TGetInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetInfoResult() *TCLIServiceGetInfoResult { - return &TCLIServiceGetInfoResult{} + return &TCLIServiceGetInfoResult{} } var TCLIServiceGetInfoResult_Success_DEFAULT *TGetInfoResp + func (p *TCLIServiceGetInfoResult) GetSuccess() *TGetInfoResp { - if !p.IsSetSuccess() { - return TCLIServiceGetInfoResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetInfoResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetInfoResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetInfoResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetInfoResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetInfoResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetInfoResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetInfo_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetInfo_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetInfoResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceGetInfoResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetInfoResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetInfoResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceExecuteStatementArgs struct { - Req *TExecuteStatementReq `thrift:"req,1" db:"req" json:"req"` + Req *TExecuteStatementReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceExecuteStatementArgs() *TCLIServiceExecuteStatementArgs { - return &TCLIServiceExecuteStatementArgs{} + return &TCLIServiceExecuteStatementArgs{} } var TCLIServiceExecuteStatementArgs_Req_DEFAULT *TExecuteStatementReq + func (p *TCLIServiceExecuteStatementArgs) GetReq() *TExecuteStatementReq { - if !p.IsSetReq() { - return TCLIServiceExecuteStatementArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceExecuteStatementArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceExecuteStatementArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceExecuteStatementArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceExecuteStatementArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TExecuteStatementReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceExecuteStatementArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TExecuteStatementReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceExecuteStatementArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "ExecuteStatement_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "ExecuteStatement_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceExecuteStatementArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceExecuteStatementArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceExecuteStatementArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceExecuteStatementArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceExecuteStatementResult struct { - Success *TExecuteStatementResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TExecuteStatementResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceExecuteStatementResult() *TCLIServiceExecuteStatementResult { - return &TCLIServiceExecuteStatementResult{} + return &TCLIServiceExecuteStatementResult{} } var TCLIServiceExecuteStatementResult_Success_DEFAULT *TExecuteStatementResp + func (p *TCLIServiceExecuteStatementResult) GetSuccess() *TExecuteStatementResp { - if !p.IsSetSuccess() { - return TCLIServiceExecuteStatementResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceExecuteStatementResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceExecuteStatementResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceExecuteStatementResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceExecuteStatementResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TExecuteStatementResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceExecuteStatementResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TExecuteStatementResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceExecuteStatementResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "ExecuteStatement_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "ExecuteStatement_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceExecuteStatementResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceExecuteStatementResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceExecuteStatementResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceExecuteStatementResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetTypeInfoArgs struct { - Req *TGetTypeInfoReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetTypeInfoReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetTypeInfoArgs() *TCLIServiceGetTypeInfoArgs { - return &TCLIServiceGetTypeInfoArgs{} + return &TCLIServiceGetTypeInfoArgs{} } var TCLIServiceGetTypeInfoArgs_Req_DEFAULT *TGetTypeInfoReq + func (p *TCLIServiceGetTypeInfoArgs) GetReq() *TGetTypeInfoReq { - if !p.IsSetReq() { - return TCLIServiceGetTypeInfoArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetTypeInfoArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetTypeInfoArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetTypeInfoArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTypeInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetTypeInfoReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetTypeInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetTypeInfoReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetTypeInfoArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTypeInfo_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetTypeInfo_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetTypeInfoArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceGetTypeInfoArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetTypeInfoArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTypeInfoArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetTypeInfoResult struct { - Success *TGetTypeInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetTypeInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetTypeInfoResult() *TCLIServiceGetTypeInfoResult { - return &TCLIServiceGetTypeInfoResult{} + return &TCLIServiceGetTypeInfoResult{} } var TCLIServiceGetTypeInfoResult_Success_DEFAULT *TGetTypeInfoResp + func (p *TCLIServiceGetTypeInfoResult) GetSuccess() *TGetTypeInfoResp { - if !p.IsSetSuccess() { - return TCLIServiceGetTypeInfoResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetTypeInfoResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetTypeInfoResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetTypeInfoResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTypeInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetTypeInfoResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetTypeInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetTypeInfoResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetTypeInfoResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTypeInfo_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetTypeInfo_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetTypeInfoResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceGetTypeInfoResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetTypeInfoResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTypeInfoResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetCatalogsArgs struct { - Req *TGetCatalogsReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetCatalogsReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetCatalogsArgs() *TCLIServiceGetCatalogsArgs { - return &TCLIServiceGetCatalogsArgs{} + return &TCLIServiceGetCatalogsArgs{} } var TCLIServiceGetCatalogsArgs_Req_DEFAULT *TGetCatalogsReq + func (p *TCLIServiceGetCatalogsArgs) GetReq() *TGetCatalogsReq { - if !p.IsSetReq() { - return TCLIServiceGetCatalogsArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetCatalogsArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetCatalogsArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetCatalogsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetCatalogsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetCatalogsReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetCatalogsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetCatalogsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetCatalogsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetCatalogs_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetCatalogs_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetCatalogsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceGetCatalogsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetCatalogsArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetCatalogsArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetCatalogsResult struct { - Success *TGetCatalogsResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetCatalogsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetCatalogsResult() *TCLIServiceGetCatalogsResult { - return &TCLIServiceGetCatalogsResult{} + return &TCLIServiceGetCatalogsResult{} } var TCLIServiceGetCatalogsResult_Success_DEFAULT *TGetCatalogsResp + func (p *TCLIServiceGetCatalogsResult) GetSuccess() *TGetCatalogsResp { - if !p.IsSetSuccess() { - return TCLIServiceGetCatalogsResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetCatalogsResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetCatalogsResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetCatalogsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetCatalogsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetCatalogsResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetCatalogsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetCatalogsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetCatalogsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetCatalogs_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetCatalogs_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetCatalogsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceGetCatalogsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetCatalogsResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetCatalogsResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetSchemasArgs struct { - Req *TGetSchemasReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetSchemasReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetSchemasArgs() *TCLIServiceGetSchemasArgs { - return &TCLIServiceGetSchemasArgs{} + return &TCLIServiceGetSchemasArgs{} } var TCLIServiceGetSchemasArgs_Req_DEFAULT *TGetSchemasReq + func (p *TCLIServiceGetSchemasArgs) GetReq() *TGetSchemasReq { - if !p.IsSetReq() { - return TCLIServiceGetSchemasArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetSchemasArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetSchemasArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetSchemasArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetSchemasArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetSchemasReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetSchemasArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetSchemasReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetSchemasArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetSchemas_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetSchemas_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetSchemasArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceGetSchemasArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetSchemasArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetSchemasArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetSchemasResult struct { - Success *TGetSchemasResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetSchemasResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetSchemasResult() *TCLIServiceGetSchemasResult { - return &TCLIServiceGetSchemasResult{} + return &TCLIServiceGetSchemasResult{} } var TCLIServiceGetSchemasResult_Success_DEFAULT *TGetSchemasResp + func (p *TCLIServiceGetSchemasResult) GetSuccess() *TGetSchemasResp { - if !p.IsSetSuccess() { - return TCLIServiceGetSchemasResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetSchemasResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetSchemasResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetSchemasResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetSchemasResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetSchemasResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetSchemasResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetSchemasResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetSchemasResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetSchemas_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetSchemas_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetSchemasResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceGetSchemasResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetSchemasResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetSchemasResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetTablesArgs struct { - Req *TGetTablesReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetTablesReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetTablesArgs() *TCLIServiceGetTablesArgs { - return &TCLIServiceGetTablesArgs{} + return &TCLIServiceGetTablesArgs{} } var TCLIServiceGetTablesArgs_Req_DEFAULT *TGetTablesReq + func (p *TCLIServiceGetTablesArgs) GetReq() *TGetTablesReq { - if !p.IsSetReq() { - return TCLIServiceGetTablesArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetTablesArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetTablesArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetTablesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTablesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetTablesReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetTablesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetTablesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetTablesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTables_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetTables_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetTablesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceGetTablesArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetTablesArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTablesArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetTablesResult struct { - Success *TGetTablesResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetTablesResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetTablesResult() *TCLIServiceGetTablesResult { - return &TCLIServiceGetTablesResult{} + return &TCLIServiceGetTablesResult{} } var TCLIServiceGetTablesResult_Success_DEFAULT *TGetTablesResp + func (p *TCLIServiceGetTablesResult) GetSuccess() *TGetTablesResp { - if !p.IsSetSuccess() { - return TCLIServiceGetTablesResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetTablesResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetTablesResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetTablesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTablesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetTablesResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetTablesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetTablesResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetTablesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTables_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetTables_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetTablesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceGetTablesResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetTablesResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTablesResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetTableTypesArgs struct { - Req *TGetTableTypesReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetTableTypesReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetTableTypesArgs() *TCLIServiceGetTableTypesArgs { - return &TCLIServiceGetTableTypesArgs{} + return &TCLIServiceGetTableTypesArgs{} } var TCLIServiceGetTableTypesArgs_Req_DEFAULT *TGetTableTypesReq + func (p *TCLIServiceGetTableTypesArgs) GetReq() *TGetTableTypesReq { - if !p.IsSetReq() { - return TCLIServiceGetTableTypesArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetTableTypesArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetTableTypesArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetTableTypesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTableTypesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetTableTypesReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetTableTypesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetTableTypesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetTableTypesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTableTypes_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetTableTypes_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetTableTypesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceGetTableTypesArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetTableTypesArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTableTypesArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetTableTypesResult struct { - Success *TGetTableTypesResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetTableTypesResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetTableTypesResult() *TCLIServiceGetTableTypesResult { - return &TCLIServiceGetTableTypesResult{} + return &TCLIServiceGetTableTypesResult{} } var TCLIServiceGetTableTypesResult_Success_DEFAULT *TGetTableTypesResp + func (p *TCLIServiceGetTableTypesResult) GetSuccess() *TGetTableTypesResp { - if !p.IsSetSuccess() { - return TCLIServiceGetTableTypesResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetTableTypesResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetTableTypesResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetTableTypesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTableTypesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetTableTypesResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetTableTypesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetTableTypesResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetTableTypesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTableTypes_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetTableTypes_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetTableTypesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceGetTableTypesResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetTableTypesResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTableTypesResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetColumnsArgs struct { - Req *TGetColumnsReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetColumnsReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetColumnsArgs() *TCLIServiceGetColumnsArgs { - return &TCLIServiceGetColumnsArgs{} + return &TCLIServiceGetColumnsArgs{} } var TCLIServiceGetColumnsArgs_Req_DEFAULT *TGetColumnsReq + func (p *TCLIServiceGetColumnsArgs) GetReq() *TGetColumnsReq { - if !p.IsSetReq() { - return TCLIServiceGetColumnsArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetColumnsArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetColumnsArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetColumnsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetColumnsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetColumnsReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetColumnsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetColumnsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetColumnsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetColumns_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetColumns_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetColumnsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceGetColumnsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetColumnsArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetColumnsArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetColumnsResult struct { - Success *TGetColumnsResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetColumnsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetColumnsResult() *TCLIServiceGetColumnsResult { - return &TCLIServiceGetColumnsResult{} + return &TCLIServiceGetColumnsResult{} } var TCLIServiceGetColumnsResult_Success_DEFAULT *TGetColumnsResp + func (p *TCLIServiceGetColumnsResult) GetSuccess() *TGetColumnsResp { - if !p.IsSetSuccess() { - return TCLIServiceGetColumnsResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetColumnsResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetColumnsResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetColumnsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetColumnsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetColumnsResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetColumnsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetColumnsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetColumnsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetColumns_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetColumns_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetColumnsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceGetColumnsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetColumnsResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetColumnsResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetFunctionsArgs struct { - Req *TGetFunctionsReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetFunctionsReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetFunctionsArgs() *TCLIServiceGetFunctionsArgs { - return &TCLIServiceGetFunctionsArgs{} + return &TCLIServiceGetFunctionsArgs{} } var TCLIServiceGetFunctionsArgs_Req_DEFAULT *TGetFunctionsReq + func (p *TCLIServiceGetFunctionsArgs) GetReq() *TGetFunctionsReq { - if !p.IsSetReq() { - return TCLIServiceGetFunctionsArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetFunctionsArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetFunctionsArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetFunctionsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetFunctionsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetFunctionsReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetFunctionsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetFunctionsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetFunctionsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetFunctions_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetFunctions_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetFunctionsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceGetFunctionsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetFunctionsArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetFunctionsArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetFunctionsResult struct { - Success *TGetFunctionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetFunctionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetFunctionsResult() *TCLIServiceGetFunctionsResult { - return &TCLIServiceGetFunctionsResult{} + return &TCLIServiceGetFunctionsResult{} } var TCLIServiceGetFunctionsResult_Success_DEFAULT *TGetFunctionsResp + func (p *TCLIServiceGetFunctionsResult) GetSuccess() *TGetFunctionsResp { - if !p.IsSetSuccess() { - return TCLIServiceGetFunctionsResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetFunctionsResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetFunctionsResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetFunctionsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetFunctionsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetFunctionsResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetFunctionsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetFunctionsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetFunctionsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetFunctions_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetFunctions_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetFunctionsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceGetFunctionsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetFunctionsResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetFunctionsResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetPrimaryKeysArgs struct { - Req *TGetPrimaryKeysReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetPrimaryKeysReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetPrimaryKeysArgs() *TCLIServiceGetPrimaryKeysArgs { - return &TCLIServiceGetPrimaryKeysArgs{} + return &TCLIServiceGetPrimaryKeysArgs{} } var TCLIServiceGetPrimaryKeysArgs_Req_DEFAULT *TGetPrimaryKeysReq + func (p *TCLIServiceGetPrimaryKeysArgs) GetReq() *TGetPrimaryKeysReq { - if !p.IsSetReq() { - return TCLIServiceGetPrimaryKeysArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetPrimaryKeysArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetPrimaryKeysArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetPrimaryKeysArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetPrimaryKeysArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetPrimaryKeysReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetPrimaryKeysArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetPrimaryKeysReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetPrimaryKeysArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetPrimaryKeys_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetPrimaryKeys_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetPrimaryKeysArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceGetPrimaryKeysArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetPrimaryKeysArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetPrimaryKeysArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetPrimaryKeysResult struct { - Success *TGetPrimaryKeysResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetPrimaryKeysResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetPrimaryKeysResult() *TCLIServiceGetPrimaryKeysResult { - return &TCLIServiceGetPrimaryKeysResult{} + return &TCLIServiceGetPrimaryKeysResult{} } var TCLIServiceGetPrimaryKeysResult_Success_DEFAULT *TGetPrimaryKeysResp + func (p *TCLIServiceGetPrimaryKeysResult) GetSuccess() *TGetPrimaryKeysResp { - if !p.IsSetSuccess() { - return TCLIServiceGetPrimaryKeysResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetPrimaryKeysResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetPrimaryKeysResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetPrimaryKeysResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetPrimaryKeysResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetPrimaryKeysResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetPrimaryKeysResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetPrimaryKeysResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetPrimaryKeysResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetPrimaryKeys_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetPrimaryKeys_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetPrimaryKeysResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceGetPrimaryKeysResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetPrimaryKeysResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetPrimaryKeysResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetCrossReferenceArgs struct { - Req *TGetCrossReferenceReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetCrossReferenceReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetCrossReferenceArgs() *TCLIServiceGetCrossReferenceArgs { - return &TCLIServiceGetCrossReferenceArgs{} + return &TCLIServiceGetCrossReferenceArgs{} } var TCLIServiceGetCrossReferenceArgs_Req_DEFAULT *TGetCrossReferenceReq + func (p *TCLIServiceGetCrossReferenceArgs) GetReq() *TGetCrossReferenceReq { - if !p.IsSetReq() { - return TCLIServiceGetCrossReferenceArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetCrossReferenceArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetCrossReferenceArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetCrossReferenceArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetCrossReferenceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetCrossReferenceReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetCrossReferenceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetCrossReferenceReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetCrossReferenceArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetCrossReference_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetCrossReference_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetCrossReferenceArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceGetCrossReferenceArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetCrossReferenceArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetCrossReferenceArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetCrossReferenceResult struct { - Success *TGetCrossReferenceResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetCrossReferenceResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetCrossReferenceResult() *TCLIServiceGetCrossReferenceResult { - return &TCLIServiceGetCrossReferenceResult{} + return &TCLIServiceGetCrossReferenceResult{} } var TCLIServiceGetCrossReferenceResult_Success_DEFAULT *TGetCrossReferenceResp + func (p *TCLIServiceGetCrossReferenceResult) GetSuccess() *TGetCrossReferenceResp { - if !p.IsSetSuccess() { - return TCLIServiceGetCrossReferenceResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetCrossReferenceResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetCrossReferenceResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetCrossReferenceResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetCrossReferenceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetCrossReferenceResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetCrossReferenceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetCrossReferenceResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetCrossReferenceResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetCrossReference_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetCrossReference_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetCrossReferenceResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceGetCrossReferenceResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetCrossReferenceResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetCrossReferenceResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetOperationStatusArgs struct { - Req *TGetOperationStatusReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetOperationStatusReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetOperationStatusArgs() *TCLIServiceGetOperationStatusArgs { - return &TCLIServiceGetOperationStatusArgs{} + return &TCLIServiceGetOperationStatusArgs{} } var TCLIServiceGetOperationStatusArgs_Req_DEFAULT *TGetOperationStatusReq + func (p *TCLIServiceGetOperationStatusArgs) GetReq() *TGetOperationStatusReq { - if !p.IsSetReq() { - return TCLIServiceGetOperationStatusArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetOperationStatusArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetOperationStatusArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetOperationStatusArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetOperationStatusArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetOperationStatusReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetOperationStatusArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetOperationStatusReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetOperationStatusArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetOperationStatus_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetOperationStatus_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetOperationStatusArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceGetOperationStatusArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetOperationStatusArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetOperationStatusArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetOperationStatusResult struct { - Success *TGetOperationStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetOperationStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetOperationStatusResult() *TCLIServiceGetOperationStatusResult { - return &TCLIServiceGetOperationStatusResult{} + return &TCLIServiceGetOperationStatusResult{} } var TCLIServiceGetOperationStatusResult_Success_DEFAULT *TGetOperationStatusResp + func (p *TCLIServiceGetOperationStatusResult) GetSuccess() *TGetOperationStatusResp { - if !p.IsSetSuccess() { - return TCLIServiceGetOperationStatusResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetOperationStatusResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetOperationStatusResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetOperationStatusResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetOperationStatusResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetOperationStatusResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetOperationStatusResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetOperationStatusResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetOperationStatusResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetOperationStatus_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetOperationStatus_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetOperationStatusResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceGetOperationStatusResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetOperationStatusResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetOperationStatusResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceCancelOperationArgs struct { - Req *TCancelOperationReq `thrift:"req,1" db:"req" json:"req"` + Req *TCancelOperationReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceCancelOperationArgs() *TCLIServiceCancelOperationArgs { - return &TCLIServiceCancelOperationArgs{} + return &TCLIServiceCancelOperationArgs{} } var TCLIServiceCancelOperationArgs_Req_DEFAULT *TCancelOperationReq + func (p *TCLIServiceCancelOperationArgs) GetReq() *TCancelOperationReq { - if !p.IsSetReq() { - return TCLIServiceCancelOperationArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceCancelOperationArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceCancelOperationArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceCancelOperationArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCancelOperationArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TCancelOperationReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCancelOperationArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TCancelOperationReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceCancelOperationArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CancelOperation_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "CancelOperation_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceCancelOperationArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceCancelOperationArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCancelOperationArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCancelOperationArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceCancelOperationResult struct { - Success *TCancelOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TCancelOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceCancelOperationResult() *TCLIServiceCancelOperationResult { - return &TCLIServiceCancelOperationResult{} + return &TCLIServiceCancelOperationResult{} } var TCLIServiceCancelOperationResult_Success_DEFAULT *TCancelOperationResp + func (p *TCLIServiceCancelOperationResult) GetSuccess() *TCancelOperationResp { - if !p.IsSetSuccess() { - return TCLIServiceCancelOperationResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceCancelOperationResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceCancelOperationResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceCancelOperationResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCancelOperationResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TCancelOperationResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCancelOperationResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TCancelOperationResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceCancelOperationResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CancelOperation_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "CancelOperation_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceCancelOperationResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceCancelOperationResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCancelOperationResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCancelOperationResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceCloseOperationArgs struct { - Req *TCloseOperationReq `thrift:"req,1" db:"req" json:"req"` + Req *TCloseOperationReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceCloseOperationArgs() *TCLIServiceCloseOperationArgs { - return &TCLIServiceCloseOperationArgs{} + return &TCLIServiceCloseOperationArgs{} } var TCLIServiceCloseOperationArgs_Req_DEFAULT *TCloseOperationReq + func (p *TCLIServiceCloseOperationArgs) GetReq() *TCloseOperationReq { - if !p.IsSetReq() { - return TCLIServiceCloseOperationArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceCloseOperationArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceCloseOperationArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceCloseOperationArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCloseOperationArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TCloseOperationReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCloseOperationArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TCloseOperationReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceCloseOperationArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CloseOperation_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "CloseOperation_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceCloseOperationArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceCloseOperationArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCloseOperationArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCloseOperationArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceCloseOperationResult struct { - Success *TCloseOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TCloseOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceCloseOperationResult() *TCLIServiceCloseOperationResult { - return &TCLIServiceCloseOperationResult{} + return &TCLIServiceCloseOperationResult{} } var TCLIServiceCloseOperationResult_Success_DEFAULT *TCloseOperationResp + func (p *TCLIServiceCloseOperationResult) GetSuccess() *TCloseOperationResp { - if !p.IsSetSuccess() { - return TCLIServiceCloseOperationResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceCloseOperationResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceCloseOperationResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceCloseOperationResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCloseOperationResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TCloseOperationResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCloseOperationResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TCloseOperationResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceCloseOperationResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CloseOperation_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "CloseOperation_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceCloseOperationResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceCloseOperationResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCloseOperationResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCloseOperationResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetResultSetMetadataArgs struct { - Req *TGetResultSetMetadataReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetResultSetMetadataReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetResultSetMetadataArgs() *TCLIServiceGetResultSetMetadataArgs { - return &TCLIServiceGetResultSetMetadataArgs{} + return &TCLIServiceGetResultSetMetadataArgs{} } var TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT *TGetResultSetMetadataReq + func (p *TCLIServiceGetResultSetMetadataArgs) GetReq() *TGetResultSetMetadataReq { - if !p.IsSetReq() { - return TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetResultSetMetadataArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetResultSetMetadataArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetResultSetMetadataArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetResultSetMetadataReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetResultSetMetadataArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetResultSetMetadataReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetResultSetMetadataArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetResultSetMetadata_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetResultSetMetadata_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetResultSetMetadataArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceGetResultSetMetadataArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetResultSetMetadataArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetResultSetMetadataArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetResultSetMetadataResult struct { - Success *TGetResultSetMetadataResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetResultSetMetadataResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetResultSetMetadataResult() *TCLIServiceGetResultSetMetadataResult { - return &TCLIServiceGetResultSetMetadataResult{} + return &TCLIServiceGetResultSetMetadataResult{} } var TCLIServiceGetResultSetMetadataResult_Success_DEFAULT *TGetResultSetMetadataResp + func (p *TCLIServiceGetResultSetMetadataResult) GetSuccess() *TGetResultSetMetadataResp { - if !p.IsSetSuccess() { - return TCLIServiceGetResultSetMetadataResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetResultSetMetadataResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetResultSetMetadataResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetResultSetMetadataResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetResultSetMetadataResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetResultSetMetadataResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetResultSetMetadataResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetResultSetMetadataResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetResultSetMetadataResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetResultSetMetadata_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetResultSetMetadata_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetResultSetMetadataResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceGetResultSetMetadataResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetResultSetMetadataResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetResultSetMetadataResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceFetchResultsArgs struct { - Req *TFetchResultsReq `thrift:"req,1" db:"req" json:"req"` + Req *TFetchResultsReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceFetchResultsArgs() *TCLIServiceFetchResultsArgs { - return &TCLIServiceFetchResultsArgs{} + return &TCLIServiceFetchResultsArgs{} } var TCLIServiceFetchResultsArgs_Req_DEFAULT *TFetchResultsReq + func (p *TCLIServiceFetchResultsArgs) GetReq() *TFetchResultsReq { - if !p.IsSetReq() { - return TCLIServiceFetchResultsArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceFetchResultsArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceFetchResultsArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceFetchResultsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceFetchResultsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TFetchResultsReq{ - Orientation: 0, -} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceFetchResultsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TFetchResultsReq{ + Orientation: 0, + } + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceFetchResultsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "FetchResults_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "FetchResults_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceFetchResultsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceFetchResultsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceFetchResultsArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceFetchResultsArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceFetchResultsResult struct { - Success *TFetchResultsResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TFetchResultsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceFetchResultsResult() *TCLIServiceFetchResultsResult { - return &TCLIServiceFetchResultsResult{} + return &TCLIServiceFetchResultsResult{} } var TCLIServiceFetchResultsResult_Success_DEFAULT *TFetchResultsResp + func (p *TCLIServiceFetchResultsResult) GetSuccess() *TFetchResultsResp { - if !p.IsSetSuccess() { - return TCLIServiceFetchResultsResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceFetchResultsResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceFetchResultsResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceFetchResultsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceFetchResultsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TFetchResultsResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceFetchResultsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TFetchResultsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceFetchResultsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "FetchResults_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "FetchResults_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceFetchResultsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceFetchResultsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceFetchResultsResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceFetchResultsResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetDelegationTokenArgs struct { - Req *TGetDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetDelegationTokenArgs() *TCLIServiceGetDelegationTokenArgs { - return &TCLIServiceGetDelegationTokenArgs{} + return &TCLIServiceGetDelegationTokenArgs{} } var TCLIServiceGetDelegationTokenArgs_Req_DEFAULT *TGetDelegationTokenReq + func (p *TCLIServiceGetDelegationTokenArgs) GetReq() *TGetDelegationTokenReq { - if !p.IsSetReq() { - return TCLIServiceGetDelegationTokenArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceGetDelegationTokenArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceGetDelegationTokenArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetDelegationTokenArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetDelegationTokenReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetDelegationTokenReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetDelegationTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetDelegationToken_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetDelegationToken_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetDelegationTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceGetDelegationTokenArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetDelegationTokenArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetDelegationTokenArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetDelegationTokenResult struct { - Success *TGetDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetDelegationTokenResult() *TCLIServiceGetDelegationTokenResult { - return &TCLIServiceGetDelegationTokenResult{} + return &TCLIServiceGetDelegationTokenResult{} } var TCLIServiceGetDelegationTokenResult_Success_DEFAULT *TGetDelegationTokenResp + func (p *TCLIServiceGetDelegationTokenResult) GetSuccess() *TGetDelegationTokenResp { - if !p.IsSetSuccess() { - return TCLIServiceGetDelegationTokenResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetDelegationTokenResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceGetDelegationTokenResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetDelegationTokenResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetDelegationTokenResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetDelegationTokenResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetDelegationTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetDelegationToken_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "GetDelegationToken_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceGetDelegationTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceGetDelegationTokenResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetDelegationTokenResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetDelegationTokenResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceCancelDelegationTokenArgs struct { - Req *TCancelDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` + Req *TCancelDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceCancelDelegationTokenArgs() *TCLIServiceCancelDelegationTokenArgs { - return &TCLIServiceCancelDelegationTokenArgs{} + return &TCLIServiceCancelDelegationTokenArgs{} } var TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT *TCancelDelegationTokenReq + func (p *TCLIServiceCancelDelegationTokenArgs) GetReq() *TCancelDelegationTokenReq { - if !p.IsSetReq() { - return TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceCancelDelegationTokenArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceCancelDelegationTokenArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCancelDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TCancelDelegationTokenReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCancelDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TCancelDelegationTokenReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceCancelDelegationTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CancelDelegationToken_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "CancelDelegationToken_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceCancelDelegationTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceCancelDelegationTokenArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCancelDelegationTokenArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCancelDelegationTokenArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceCancelDelegationTokenResult struct { - Success *TCancelDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TCancelDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceCancelDelegationTokenResult() *TCLIServiceCancelDelegationTokenResult { - return &TCLIServiceCancelDelegationTokenResult{} + return &TCLIServiceCancelDelegationTokenResult{} } var TCLIServiceCancelDelegationTokenResult_Success_DEFAULT *TCancelDelegationTokenResp + func (p *TCLIServiceCancelDelegationTokenResult) GetSuccess() *TCancelDelegationTokenResp { - if !p.IsSetSuccess() { - return TCLIServiceCancelDelegationTokenResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceCancelDelegationTokenResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceCancelDelegationTokenResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceCancelDelegationTokenResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCancelDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TCancelDelegationTokenResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCancelDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TCancelDelegationTokenResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceCancelDelegationTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CancelDelegationToken_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "CancelDelegationToken_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceCancelDelegationTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceCancelDelegationTokenResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCancelDelegationTokenResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCancelDelegationTokenResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceRenewDelegationTokenArgs struct { - Req *TRenewDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` + Req *TRenewDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceRenewDelegationTokenArgs() *TCLIServiceRenewDelegationTokenArgs { - return &TCLIServiceRenewDelegationTokenArgs{} + return &TCLIServiceRenewDelegationTokenArgs{} } var TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT *TRenewDelegationTokenReq + func (p *TCLIServiceRenewDelegationTokenArgs) GetReq() *TRenewDelegationTokenReq { - if !p.IsSetReq() { - return TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT - } -return p.Req + if !p.IsSetReq() { + return TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT + } + return p.Req } func (p *TCLIServiceRenewDelegationTokenArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceRenewDelegationTokenArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceRenewDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TRenewDelegationTokenReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceRenewDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TRenewDelegationTokenReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceRenewDelegationTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "RenewDelegationToken_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "RenewDelegationToken_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceRenewDelegationTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) + } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) + } + return err } func (p *TCLIServiceRenewDelegationTokenArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceRenewDelegationTokenArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceRenewDelegationTokenArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceRenewDelegationTokenResult struct { - Success *TRenewDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TRenewDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceRenewDelegationTokenResult() *TCLIServiceRenewDelegationTokenResult { - return &TCLIServiceRenewDelegationTokenResult{} + return &TCLIServiceRenewDelegationTokenResult{} } var TCLIServiceRenewDelegationTokenResult_Success_DEFAULT *TRenewDelegationTokenResp + func (p *TCLIServiceRenewDelegationTokenResult) GetSuccess() *TRenewDelegationTokenResp { - if !p.IsSetSuccess() { - return TCLIServiceRenewDelegationTokenResult_Success_DEFAULT - } -return p.Success + if !p.IsSetSuccess() { + return TCLIServiceRenewDelegationTokenResult_Success_DEFAULT + } + return p.Success } func (p *TCLIServiceRenewDelegationTokenResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceRenewDelegationTokenResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceRenewDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TRenewDelegationTokenResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceRenewDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TRenewDelegationTokenResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceRenewDelegationTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "RenewDelegationToken_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil + if err := oprot.WriteStructBegin(ctx, "RenewDelegationToken_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { + return err + } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) + } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) + } + return nil } func (p *TCLIServiceRenewDelegationTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err } func (p *TCLIServiceRenewDelegationTokenResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceRenewDelegationTokenResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceRenewDelegationTokenResult(%+v)", *p) } - - From 772762232212577f940fd102d7f55063a1da64f7 Mon Sep 17 00:00:00 2001 From: Madhav Sainanee Date: Wed, 29 Oct 2025 11:16:39 +0000 Subject: [PATCH 8/8] undo lint --- internal/cli_service/GoUnusedProtection__.go | 3 +- internal/cli_service/cli_service-consts.go | 65 +- internal/cli_service/cli_service.go | 50286 ++++++++--------- 3 files changed, 23351 insertions(+), 27003 deletions(-) diff --git a/internal/cli_service/GoUnusedProtection__.go b/internal/cli_service/GoUnusedProtection__.go index 3e573a70..130d291d 100644 --- a/internal/cli_service/GoUnusedProtection__.go +++ b/internal/cli_service/GoUnusedProtection__.go @@ -2,4 +2,5 @@ package cli_service -var GoUnusedProtection__ int +var GoUnusedProtection__ int; + diff --git a/internal/cli_service/cli_service-consts.go b/internal/cli_service/cli_service-consts.go index 2ad6a148..1048c269 100644 --- a/internal/cli_service/cli_service-consts.go +++ b/internal/cli_service/cli_service-consts.go @@ -7,10 +7,10 @@ import ( "context" "errors" "fmt" + "time" thrift "github.com/apache/thrift/lib/go/thrift" - "regexp" "strings" - "time" + "regexp" ) // (needed to ensure safety because of naive import list construction.) @@ -20,7 +20,6 @@ var _ = errors.New var _ = context.Background var _ = time.Now var _ = bytes.Equal - // (needed by validator.) var _ = strings.Contains var _ = regexp.MatchString @@ -29,43 +28,43 @@ var PRIMITIVE_TYPES []TTypeId var COMPLEX_TYPES []TTypeId var COLLECTION_TYPES []TTypeId var TYPE_NAMES map[TTypeId]string - const CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength" const PRECISION = "precision" const SCALE = "scale" func init() { - PRIMITIVE_TYPES = []TTypeId{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 21} +PRIMITIVE_TYPES = []TTypeId{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 21, } - COMPLEX_TYPES = []TTypeId{ - 10, 11, 12, 13, 14} +COMPLEX_TYPES = []TTypeId{ + 10, 11, 12, 13, 14, } - COLLECTION_TYPES = []TTypeId{ - 10, 11} +COLLECTION_TYPES = []TTypeId{ + 10, 11, } - TYPE_NAMES = map[TTypeId]string{ - 10: "ARRAY", - 4: "BIGINT", - 9: "BINARY", - 0: "BOOLEAN", - 19: "CHAR", - 17: "DATE", - 15: "DECIMAL", - 6: "DOUBLE", - 5: "FLOAT", - 21: "INTERVAL_DAY_TIME", - 20: "INTERVAL_YEAR_MONTH", - 3: "INT", - 11: "MAP", - 16: "NULL", - 2: "SMALLINT", - 7: "STRING", - 12: "STRUCT", - 8: "TIMESTAMP", - 1: "TINYINT", - 13: "UNIONTYPE", - 18: "VARCHAR", - } +TYPE_NAMES = map[TTypeId]string{ + 10: "ARRAY", + 4: "BIGINT", + 9: "BINARY", + 0: "BOOLEAN", + 19: "CHAR", + 17: "DATE", + 15: "DECIMAL", + 6: "DOUBLE", + 5: "FLOAT", + 21: "INTERVAL_DAY_TIME", + 20: "INTERVAL_YEAR_MONTH", + 3: "INT", + 11: "MAP", + 16: "NULL", + 2: "SMALLINT", + 7: "STRING", + 12: "STRUCT", + 8: "TIMESTAMP", + 1: "TINYINT", + 13: "UNIONTYPE", + 18: "VARCHAR", +} } + diff --git a/internal/cli_service/cli_service.go b/internal/cli_service/cli_service.go index c4eee3a4..71952c69 100644 --- a/internal/cli_service/cli_service.go +++ b/internal/cli_service/cli_service.go @@ -8,10 +8,10 @@ import ( "database/sql/driver" "errors" "fmt" + "time" thrift "github.com/apache/thrift/lib/go/thrift" - "regexp" "strings" - "time" + "regexp" ) // (needed to ensure safety because of naive import list construction.) @@ -21,1262 +21,979 @@ var _ = errors.New var _ = context.Background var _ = time.Now var _ = bytes.Equal - // (needed by validator.) var _ = strings.Contains var _ = regexp.MatchString type TProtocolVersion int64 - const ( - TProtocolVersion___HIVE_JDBC_WORKAROUND TProtocolVersion = -7 - TProtocolVersion___TEST_PROTOCOL_VERSION TProtocolVersion = 65281 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1 TProtocolVersion = 0 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2 TProtocolVersion = 1 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3 TProtocolVersion = 2 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4 TProtocolVersion = 3 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5 TProtocolVersion = 4 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6 TProtocolVersion = 5 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7 TProtocolVersion = 6 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8 TProtocolVersion = 7 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9 TProtocolVersion = 8 - TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10 TProtocolVersion = 9 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V1 TProtocolVersion = 42241 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V2 TProtocolVersion = 42242 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V3 TProtocolVersion = 42243 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V4 TProtocolVersion = 42244 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V5 TProtocolVersion = 42245 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6 TProtocolVersion = 42246 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V7 TProtocolVersion = 42247 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V8 TProtocolVersion = 42248 - TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V9 TProtocolVersion = 42249 + TProtocolVersion___HIVE_JDBC_WORKAROUND TProtocolVersion = -7 + TProtocolVersion___TEST_PROTOCOL_VERSION TProtocolVersion = 65281 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1 TProtocolVersion = 0 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2 TProtocolVersion = 1 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3 TProtocolVersion = 2 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4 TProtocolVersion = 3 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5 TProtocolVersion = 4 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6 TProtocolVersion = 5 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7 TProtocolVersion = 6 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8 TProtocolVersion = 7 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9 TProtocolVersion = 8 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10 TProtocolVersion = 9 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V1 TProtocolVersion = 42241 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V2 TProtocolVersion = 42242 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V3 TProtocolVersion = 42243 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V4 TProtocolVersion = 42244 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V5 TProtocolVersion = 42245 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6 TProtocolVersion = 42246 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V7 TProtocolVersion = 42247 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V8 TProtocolVersion = 42248 + TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V9 TProtocolVersion = 42249 ) func (p TProtocolVersion) String() string { - switch p { - case TProtocolVersion___HIVE_JDBC_WORKAROUND: - return "__HIVE_JDBC_WORKAROUND" - case TProtocolVersion___TEST_PROTOCOL_VERSION: - return "__TEST_PROTOCOL_VERSION" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1: - return "HIVE_CLI_SERVICE_PROTOCOL_V1" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2: - return "HIVE_CLI_SERVICE_PROTOCOL_V2" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3: - return "HIVE_CLI_SERVICE_PROTOCOL_V3" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4: - return "HIVE_CLI_SERVICE_PROTOCOL_V4" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5: - return "HIVE_CLI_SERVICE_PROTOCOL_V5" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6: - return "HIVE_CLI_SERVICE_PROTOCOL_V6" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7: - return "HIVE_CLI_SERVICE_PROTOCOL_V7" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8: - return "HIVE_CLI_SERVICE_PROTOCOL_V8" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9: - return "HIVE_CLI_SERVICE_PROTOCOL_V9" - case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10: - return "HIVE_CLI_SERVICE_PROTOCOL_V10" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V1: - return "SPARK_CLI_SERVICE_PROTOCOL_V1" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V2: - return "SPARK_CLI_SERVICE_PROTOCOL_V2" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V3: - return "SPARK_CLI_SERVICE_PROTOCOL_V3" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V4: - return "SPARK_CLI_SERVICE_PROTOCOL_V4" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V5: - return "SPARK_CLI_SERVICE_PROTOCOL_V5" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6: - return "SPARK_CLI_SERVICE_PROTOCOL_V6" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V7: - return "SPARK_CLI_SERVICE_PROTOCOL_V7" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V8: - return "SPARK_CLI_SERVICE_PROTOCOL_V8" - case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V9: - return "SPARK_CLI_SERVICE_PROTOCOL_V9" - } - return "" + switch p { + case TProtocolVersion___HIVE_JDBC_WORKAROUND: return "__HIVE_JDBC_WORKAROUND" + case TProtocolVersion___TEST_PROTOCOL_VERSION: return "__TEST_PROTOCOL_VERSION" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1: return "HIVE_CLI_SERVICE_PROTOCOL_V1" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2: return "HIVE_CLI_SERVICE_PROTOCOL_V2" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3: return "HIVE_CLI_SERVICE_PROTOCOL_V3" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4: return "HIVE_CLI_SERVICE_PROTOCOL_V4" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5: return "HIVE_CLI_SERVICE_PROTOCOL_V5" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6: return "HIVE_CLI_SERVICE_PROTOCOL_V6" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7: return "HIVE_CLI_SERVICE_PROTOCOL_V7" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8: return "HIVE_CLI_SERVICE_PROTOCOL_V8" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9: return "HIVE_CLI_SERVICE_PROTOCOL_V9" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10: return "HIVE_CLI_SERVICE_PROTOCOL_V10" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V1: return "SPARK_CLI_SERVICE_PROTOCOL_V1" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V2: return "SPARK_CLI_SERVICE_PROTOCOL_V2" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V3: return "SPARK_CLI_SERVICE_PROTOCOL_V3" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V4: return "SPARK_CLI_SERVICE_PROTOCOL_V4" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V5: return "SPARK_CLI_SERVICE_PROTOCOL_V5" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6: return "SPARK_CLI_SERVICE_PROTOCOL_V6" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V7: return "SPARK_CLI_SERVICE_PROTOCOL_V7" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V8: return "SPARK_CLI_SERVICE_PROTOCOL_V8" + case TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V9: return "SPARK_CLI_SERVICE_PROTOCOL_V9" + } + return "" } func TProtocolVersionFromString(s string) (TProtocolVersion, error) { - switch s { - case "__HIVE_JDBC_WORKAROUND": - return TProtocolVersion___HIVE_JDBC_WORKAROUND, nil - case "__TEST_PROTOCOL_VERSION": - return TProtocolVersion___TEST_PROTOCOL_VERSION, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V1": - return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V2": - return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V3": - return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V4": - return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V5": - return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V6": - return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V7": - return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V8": - return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V9": - return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9, nil - case "HIVE_CLI_SERVICE_PROTOCOL_V10": - return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V1": - return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V1, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V2": - return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V2, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V3": - return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V3, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V4": - return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V4, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V5": - return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V5, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V6": - return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V7": - return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V7, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V8": - return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V8, nil - case "SPARK_CLI_SERVICE_PROTOCOL_V9": - return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V9, nil - } - return TProtocolVersion(0), fmt.Errorf("not a valid TProtocolVersion string") + switch s { + case "__HIVE_JDBC_WORKAROUND": return TProtocolVersion___HIVE_JDBC_WORKAROUND, nil + case "__TEST_PROTOCOL_VERSION": return TProtocolVersion___TEST_PROTOCOL_VERSION, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V1": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V1, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V2": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V2, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V3": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V3, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V4": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V4, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V5": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V5, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V6": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V7": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V8": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V9": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V10": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V1": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V1, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V2": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V2, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V3": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V3, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V4": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V4, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V5": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V5, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V6": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V6, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V7": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V7, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V8": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V8, nil + case "SPARK_CLI_SERVICE_PROTOCOL_V9": return TProtocolVersion_SPARK_CLI_SERVICE_PROTOCOL_V9, nil + } + return TProtocolVersion(0), fmt.Errorf("not a valid TProtocolVersion string") } + func TProtocolVersionPtr(v TProtocolVersion) *TProtocolVersion { return &v } func (p TProtocolVersion) MarshalText() ([]byte, error) { - return []byte(p.String()), nil +return []byte(p.String()), nil } func (p *TProtocolVersion) UnmarshalText(text []byte) error { - q, err := TProtocolVersionFromString(string(text)) - if err != nil { - return err - } - *p = q - return nil +q, err := TProtocolVersionFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil } func (p *TProtocolVersion) Scan(value interface{}) error { - v, ok := value.(int64) - if !ok { - return errors.New("Scan value is not int64") - } - *p = TProtocolVersion(v) - return nil +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") } - -func (p *TProtocolVersion) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil +*p = TProtocolVersion(v) +return nil } +func (p * TProtocolVersion) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} type TTypeId int64 - const ( - TTypeId_BOOLEAN_TYPE TTypeId = 0 - TTypeId_TINYINT_TYPE TTypeId = 1 - TTypeId_SMALLINT_TYPE TTypeId = 2 - TTypeId_INT_TYPE TTypeId = 3 - TTypeId_BIGINT_TYPE TTypeId = 4 - TTypeId_FLOAT_TYPE TTypeId = 5 - TTypeId_DOUBLE_TYPE TTypeId = 6 - TTypeId_STRING_TYPE TTypeId = 7 - TTypeId_TIMESTAMP_TYPE TTypeId = 8 - TTypeId_BINARY_TYPE TTypeId = 9 - TTypeId_ARRAY_TYPE TTypeId = 10 - TTypeId_MAP_TYPE TTypeId = 11 - TTypeId_STRUCT_TYPE TTypeId = 12 - TTypeId_UNION_TYPE TTypeId = 13 - TTypeId_USER_DEFINED_TYPE TTypeId = 14 - TTypeId_DECIMAL_TYPE TTypeId = 15 - TTypeId_NULL_TYPE TTypeId = 16 - TTypeId_DATE_TYPE TTypeId = 17 - TTypeId_VARCHAR_TYPE TTypeId = 18 - TTypeId_CHAR_TYPE TTypeId = 19 - TTypeId_INTERVAL_YEAR_MONTH_TYPE TTypeId = 20 - TTypeId_INTERVAL_DAY_TIME_TYPE TTypeId = 21 + TTypeId_BOOLEAN_TYPE TTypeId = 0 + TTypeId_TINYINT_TYPE TTypeId = 1 + TTypeId_SMALLINT_TYPE TTypeId = 2 + TTypeId_INT_TYPE TTypeId = 3 + TTypeId_BIGINT_TYPE TTypeId = 4 + TTypeId_FLOAT_TYPE TTypeId = 5 + TTypeId_DOUBLE_TYPE TTypeId = 6 + TTypeId_STRING_TYPE TTypeId = 7 + TTypeId_TIMESTAMP_TYPE TTypeId = 8 + TTypeId_BINARY_TYPE TTypeId = 9 + TTypeId_ARRAY_TYPE TTypeId = 10 + TTypeId_MAP_TYPE TTypeId = 11 + TTypeId_STRUCT_TYPE TTypeId = 12 + TTypeId_UNION_TYPE TTypeId = 13 + TTypeId_USER_DEFINED_TYPE TTypeId = 14 + TTypeId_DECIMAL_TYPE TTypeId = 15 + TTypeId_NULL_TYPE TTypeId = 16 + TTypeId_DATE_TYPE TTypeId = 17 + TTypeId_VARCHAR_TYPE TTypeId = 18 + TTypeId_CHAR_TYPE TTypeId = 19 + TTypeId_INTERVAL_YEAR_MONTH_TYPE TTypeId = 20 + TTypeId_INTERVAL_DAY_TIME_TYPE TTypeId = 21 ) func (p TTypeId) String() string { - switch p { - case TTypeId_BOOLEAN_TYPE: - return "BOOLEAN_TYPE" - case TTypeId_TINYINT_TYPE: - return "TINYINT_TYPE" - case TTypeId_SMALLINT_TYPE: - return "SMALLINT_TYPE" - case TTypeId_INT_TYPE: - return "INT_TYPE" - case TTypeId_BIGINT_TYPE: - return "BIGINT_TYPE" - case TTypeId_FLOAT_TYPE: - return "FLOAT_TYPE" - case TTypeId_DOUBLE_TYPE: - return "DOUBLE_TYPE" - case TTypeId_STRING_TYPE: - return "STRING_TYPE" - case TTypeId_TIMESTAMP_TYPE: - return "TIMESTAMP_TYPE" - case TTypeId_BINARY_TYPE: - return "BINARY_TYPE" - case TTypeId_ARRAY_TYPE: - return "ARRAY_TYPE" - case TTypeId_MAP_TYPE: - return "MAP_TYPE" - case TTypeId_STRUCT_TYPE: - return "STRUCT_TYPE" - case TTypeId_UNION_TYPE: - return "UNION_TYPE" - case TTypeId_USER_DEFINED_TYPE: - return "USER_DEFINED_TYPE" - case TTypeId_DECIMAL_TYPE: - return "DECIMAL_TYPE" - case TTypeId_NULL_TYPE: - return "NULL_TYPE" - case TTypeId_DATE_TYPE: - return "DATE_TYPE" - case TTypeId_VARCHAR_TYPE: - return "VARCHAR_TYPE" - case TTypeId_CHAR_TYPE: - return "CHAR_TYPE" - case TTypeId_INTERVAL_YEAR_MONTH_TYPE: - return "INTERVAL_YEAR_MONTH_TYPE" - case TTypeId_INTERVAL_DAY_TIME_TYPE: - return "INTERVAL_DAY_TIME_TYPE" - } - return "" + switch p { + case TTypeId_BOOLEAN_TYPE: return "BOOLEAN_TYPE" + case TTypeId_TINYINT_TYPE: return "TINYINT_TYPE" + case TTypeId_SMALLINT_TYPE: return "SMALLINT_TYPE" + case TTypeId_INT_TYPE: return "INT_TYPE" + case TTypeId_BIGINT_TYPE: return "BIGINT_TYPE" + case TTypeId_FLOAT_TYPE: return "FLOAT_TYPE" + case TTypeId_DOUBLE_TYPE: return "DOUBLE_TYPE" + case TTypeId_STRING_TYPE: return "STRING_TYPE" + case TTypeId_TIMESTAMP_TYPE: return "TIMESTAMP_TYPE" + case TTypeId_BINARY_TYPE: return "BINARY_TYPE" + case TTypeId_ARRAY_TYPE: return "ARRAY_TYPE" + case TTypeId_MAP_TYPE: return "MAP_TYPE" + case TTypeId_STRUCT_TYPE: return "STRUCT_TYPE" + case TTypeId_UNION_TYPE: return "UNION_TYPE" + case TTypeId_USER_DEFINED_TYPE: return "USER_DEFINED_TYPE" + case TTypeId_DECIMAL_TYPE: return "DECIMAL_TYPE" + case TTypeId_NULL_TYPE: return "NULL_TYPE" + case TTypeId_DATE_TYPE: return "DATE_TYPE" + case TTypeId_VARCHAR_TYPE: return "VARCHAR_TYPE" + case TTypeId_CHAR_TYPE: return "CHAR_TYPE" + case TTypeId_INTERVAL_YEAR_MONTH_TYPE: return "INTERVAL_YEAR_MONTH_TYPE" + case TTypeId_INTERVAL_DAY_TIME_TYPE: return "INTERVAL_DAY_TIME_TYPE" + } + return "" } func TTypeIdFromString(s string) (TTypeId, error) { - switch s { - case "BOOLEAN_TYPE": - return TTypeId_BOOLEAN_TYPE, nil - case "TINYINT_TYPE": - return TTypeId_TINYINT_TYPE, nil - case "SMALLINT_TYPE": - return TTypeId_SMALLINT_TYPE, nil - case "INT_TYPE": - return TTypeId_INT_TYPE, nil - case "BIGINT_TYPE": - return TTypeId_BIGINT_TYPE, nil - case "FLOAT_TYPE": - return TTypeId_FLOAT_TYPE, nil - case "DOUBLE_TYPE": - return TTypeId_DOUBLE_TYPE, nil - case "STRING_TYPE": - return TTypeId_STRING_TYPE, nil - case "TIMESTAMP_TYPE": - return TTypeId_TIMESTAMP_TYPE, nil - case "BINARY_TYPE": - return TTypeId_BINARY_TYPE, nil - case "ARRAY_TYPE": - return TTypeId_ARRAY_TYPE, nil - case "MAP_TYPE": - return TTypeId_MAP_TYPE, nil - case "STRUCT_TYPE": - return TTypeId_STRUCT_TYPE, nil - case "UNION_TYPE": - return TTypeId_UNION_TYPE, nil - case "USER_DEFINED_TYPE": - return TTypeId_USER_DEFINED_TYPE, nil - case "DECIMAL_TYPE": - return TTypeId_DECIMAL_TYPE, nil - case "NULL_TYPE": - return TTypeId_NULL_TYPE, nil - case "DATE_TYPE": - return TTypeId_DATE_TYPE, nil - case "VARCHAR_TYPE": - return TTypeId_VARCHAR_TYPE, nil - case "CHAR_TYPE": - return TTypeId_CHAR_TYPE, nil - case "INTERVAL_YEAR_MONTH_TYPE": - return TTypeId_INTERVAL_YEAR_MONTH_TYPE, nil - case "INTERVAL_DAY_TIME_TYPE": - return TTypeId_INTERVAL_DAY_TIME_TYPE, nil - } - return TTypeId(0), fmt.Errorf("not a valid TTypeId string") + switch s { + case "BOOLEAN_TYPE": return TTypeId_BOOLEAN_TYPE, nil + case "TINYINT_TYPE": return TTypeId_TINYINT_TYPE, nil + case "SMALLINT_TYPE": return TTypeId_SMALLINT_TYPE, nil + case "INT_TYPE": return TTypeId_INT_TYPE, nil + case "BIGINT_TYPE": return TTypeId_BIGINT_TYPE, nil + case "FLOAT_TYPE": return TTypeId_FLOAT_TYPE, nil + case "DOUBLE_TYPE": return TTypeId_DOUBLE_TYPE, nil + case "STRING_TYPE": return TTypeId_STRING_TYPE, nil + case "TIMESTAMP_TYPE": return TTypeId_TIMESTAMP_TYPE, nil + case "BINARY_TYPE": return TTypeId_BINARY_TYPE, nil + case "ARRAY_TYPE": return TTypeId_ARRAY_TYPE, nil + case "MAP_TYPE": return TTypeId_MAP_TYPE, nil + case "STRUCT_TYPE": return TTypeId_STRUCT_TYPE, nil + case "UNION_TYPE": return TTypeId_UNION_TYPE, nil + case "USER_DEFINED_TYPE": return TTypeId_USER_DEFINED_TYPE, nil + case "DECIMAL_TYPE": return TTypeId_DECIMAL_TYPE, nil + case "NULL_TYPE": return TTypeId_NULL_TYPE, nil + case "DATE_TYPE": return TTypeId_DATE_TYPE, nil + case "VARCHAR_TYPE": return TTypeId_VARCHAR_TYPE, nil + case "CHAR_TYPE": return TTypeId_CHAR_TYPE, nil + case "INTERVAL_YEAR_MONTH_TYPE": return TTypeId_INTERVAL_YEAR_MONTH_TYPE, nil + case "INTERVAL_DAY_TIME_TYPE": return TTypeId_INTERVAL_DAY_TIME_TYPE, nil + } + return TTypeId(0), fmt.Errorf("not a valid TTypeId string") } + func TTypeIdPtr(v TTypeId) *TTypeId { return &v } func (p TTypeId) MarshalText() ([]byte, error) { - return []byte(p.String()), nil +return []byte(p.String()), nil } func (p *TTypeId) UnmarshalText(text []byte) error { - q, err := TTypeIdFromString(string(text)) - if err != nil { - return err - } - *p = q - return nil +q, err := TTypeIdFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil } func (p *TTypeId) Scan(value interface{}) error { - v, ok := value.(int64) - if !ok { - return errors.New("Scan value is not int64") - } - *p = TTypeId(v) - return nil +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") } - -func (p *TTypeId) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil +*p = TTypeId(v) +return nil } +func (p * TTypeId) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} type TSparkRowSetType int64 - const ( - TSparkRowSetType_ARROW_BASED_SET TSparkRowSetType = 0 - TSparkRowSetType_COLUMN_BASED_SET TSparkRowSetType = 1 - TSparkRowSetType_ROW_BASED_SET TSparkRowSetType = 2 - TSparkRowSetType_URL_BASED_SET TSparkRowSetType = 3 + TSparkRowSetType_ARROW_BASED_SET TSparkRowSetType = 0 + TSparkRowSetType_COLUMN_BASED_SET TSparkRowSetType = 1 + TSparkRowSetType_ROW_BASED_SET TSparkRowSetType = 2 + TSparkRowSetType_URL_BASED_SET TSparkRowSetType = 3 ) func (p TSparkRowSetType) String() string { - switch p { - case TSparkRowSetType_ARROW_BASED_SET: - return "ARROW_BASED_SET" - case TSparkRowSetType_COLUMN_BASED_SET: - return "COLUMN_BASED_SET" - case TSparkRowSetType_ROW_BASED_SET: - return "ROW_BASED_SET" - case TSparkRowSetType_URL_BASED_SET: - return "URL_BASED_SET" - } - return "" + switch p { + case TSparkRowSetType_ARROW_BASED_SET: return "ARROW_BASED_SET" + case TSparkRowSetType_COLUMN_BASED_SET: return "COLUMN_BASED_SET" + case TSparkRowSetType_ROW_BASED_SET: return "ROW_BASED_SET" + case TSparkRowSetType_URL_BASED_SET: return "URL_BASED_SET" + } + return "" } func TSparkRowSetTypeFromString(s string) (TSparkRowSetType, error) { - switch s { - case "ARROW_BASED_SET": - return TSparkRowSetType_ARROW_BASED_SET, nil - case "COLUMN_BASED_SET": - return TSparkRowSetType_COLUMN_BASED_SET, nil - case "ROW_BASED_SET": - return TSparkRowSetType_ROW_BASED_SET, nil - case "URL_BASED_SET": - return TSparkRowSetType_URL_BASED_SET, nil - } - return TSparkRowSetType(0), fmt.Errorf("not a valid TSparkRowSetType string") + switch s { + case "ARROW_BASED_SET": return TSparkRowSetType_ARROW_BASED_SET, nil + case "COLUMN_BASED_SET": return TSparkRowSetType_COLUMN_BASED_SET, nil + case "ROW_BASED_SET": return TSparkRowSetType_ROW_BASED_SET, nil + case "URL_BASED_SET": return TSparkRowSetType_URL_BASED_SET, nil + } + return TSparkRowSetType(0), fmt.Errorf("not a valid TSparkRowSetType string") } + func TSparkRowSetTypePtr(v TSparkRowSetType) *TSparkRowSetType { return &v } func (p TSparkRowSetType) MarshalText() ([]byte, error) { - return []byte(p.String()), nil +return []byte(p.String()), nil } func (p *TSparkRowSetType) UnmarshalText(text []byte) error { - q, err := TSparkRowSetTypeFromString(string(text)) - if err != nil { - return err - } - *p = q - return nil +q, err := TSparkRowSetTypeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil } func (p *TSparkRowSetType) Scan(value interface{}) error { - v, ok := value.(int64) - if !ok { - return errors.New("Scan value is not int64") - } - *p = TSparkRowSetType(v) - return nil +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") } - -func (p *TSparkRowSetType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil +*p = TSparkRowSetType(v) +return nil } +func (p * TSparkRowSetType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} type TDBSqlCompressionCodec int64 - const ( - TDBSqlCompressionCodec_NONE TDBSqlCompressionCodec = 0 - TDBSqlCompressionCodec_LZ4_FRAME TDBSqlCompressionCodec = 1 - TDBSqlCompressionCodec_LZ4_BLOCK TDBSqlCompressionCodec = 2 + TDBSqlCompressionCodec_NONE TDBSqlCompressionCodec = 0 + TDBSqlCompressionCodec_LZ4_FRAME TDBSqlCompressionCodec = 1 + TDBSqlCompressionCodec_LZ4_BLOCK TDBSqlCompressionCodec = 2 ) func (p TDBSqlCompressionCodec) String() string { - switch p { - case TDBSqlCompressionCodec_NONE: - return "NONE" - case TDBSqlCompressionCodec_LZ4_FRAME: - return "LZ4_FRAME" - case TDBSqlCompressionCodec_LZ4_BLOCK: - return "LZ4_BLOCK" - } - return "" + switch p { + case TDBSqlCompressionCodec_NONE: return "NONE" + case TDBSqlCompressionCodec_LZ4_FRAME: return "LZ4_FRAME" + case TDBSqlCompressionCodec_LZ4_BLOCK: return "LZ4_BLOCK" + } + return "" } func TDBSqlCompressionCodecFromString(s string) (TDBSqlCompressionCodec, error) { - switch s { - case "NONE": - return TDBSqlCompressionCodec_NONE, nil - case "LZ4_FRAME": - return TDBSqlCompressionCodec_LZ4_FRAME, nil - case "LZ4_BLOCK": - return TDBSqlCompressionCodec_LZ4_BLOCK, nil - } - return TDBSqlCompressionCodec(0), fmt.Errorf("not a valid TDBSqlCompressionCodec string") + switch s { + case "NONE": return TDBSqlCompressionCodec_NONE, nil + case "LZ4_FRAME": return TDBSqlCompressionCodec_LZ4_FRAME, nil + case "LZ4_BLOCK": return TDBSqlCompressionCodec_LZ4_BLOCK, nil + } + return TDBSqlCompressionCodec(0), fmt.Errorf("not a valid TDBSqlCompressionCodec string") } + func TDBSqlCompressionCodecPtr(v TDBSqlCompressionCodec) *TDBSqlCompressionCodec { return &v } func (p TDBSqlCompressionCodec) MarshalText() ([]byte, error) { - return []byte(p.String()), nil +return []byte(p.String()), nil } func (p *TDBSqlCompressionCodec) UnmarshalText(text []byte) error { - q, err := TDBSqlCompressionCodecFromString(string(text)) - if err != nil { - return err - } - *p = q - return nil +q, err := TDBSqlCompressionCodecFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil } func (p *TDBSqlCompressionCodec) Scan(value interface{}) error { - v, ok := value.(int64) - if !ok { - return errors.New("Scan value is not int64") - } - *p = TDBSqlCompressionCodec(v) - return nil +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") } - -func (p *TDBSqlCompressionCodec) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil +*p = TDBSqlCompressionCodec(v) +return nil } +func (p * TDBSqlCompressionCodec) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} type TDBSqlArrowLayout int64 - const ( - TDBSqlArrowLayout_ARROW_BATCH TDBSqlArrowLayout = 0 - TDBSqlArrowLayout_ARROW_STREAMING TDBSqlArrowLayout = 1 + TDBSqlArrowLayout_ARROW_BATCH TDBSqlArrowLayout = 0 + TDBSqlArrowLayout_ARROW_STREAMING TDBSqlArrowLayout = 1 ) func (p TDBSqlArrowLayout) String() string { - switch p { - case TDBSqlArrowLayout_ARROW_BATCH: - return "ARROW_BATCH" - case TDBSqlArrowLayout_ARROW_STREAMING: - return "ARROW_STREAMING" - } - return "" + switch p { + case TDBSqlArrowLayout_ARROW_BATCH: return "ARROW_BATCH" + case TDBSqlArrowLayout_ARROW_STREAMING: return "ARROW_STREAMING" + } + return "" } func TDBSqlArrowLayoutFromString(s string) (TDBSqlArrowLayout, error) { - switch s { - case "ARROW_BATCH": - return TDBSqlArrowLayout_ARROW_BATCH, nil - case "ARROW_STREAMING": - return TDBSqlArrowLayout_ARROW_STREAMING, nil - } - return TDBSqlArrowLayout(0), fmt.Errorf("not a valid TDBSqlArrowLayout string") + switch s { + case "ARROW_BATCH": return TDBSqlArrowLayout_ARROW_BATCH, nil + case "ARROW_STREAMING": return TDBSqlArrowLayout_ARROW_STREAMING, nil + } + return TDBSqlArrowLayout(0), fmt.Errorf("not a valid TDBSqlArrowLayout string") } + func TDBSqlArrowLayoutPtr(v TDBSqlArrowLayout) *TDBSqlArrowLayout { return &v } func (p TDBSqlArrowLayout) MarshalText() ([]byte, error) { - return []byte(p.String()), nil +return []byte(p.String()), nil } func (p *TDBSqlArrowLayout) UnmarshalText(text []byte) error { - q, err := TDBSqlArrowLayoutFromString(string(text)) - if err != nil { - return err - } - *p = q - return nil +q, err := TDBSqlArrowLayoutFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil } func (p *TDBSqlArrowLayout) Scan(value interface{}) error { - v, ok := value.(int64) - if !ok { - return errors.New("Scan value is not int64") - } - *p = TDBSqlArrowLayout(v) - return nil +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") } - -func (p *TDBSqlArrowLayout) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil +*p = TDBSqlArrowLayout(v) +return nil } +func (p * TDBSqlArrowLayout) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} type TStatusCode int64 - const ( - TStatusCode_SUCCESS_STATUS TStatusCode = 0 - TStatusCode_SUCCESS_WITH_INFO_STATUS TStatusCode = 1 - TStatusCode_STILL_EXECUTING_STATUS TStatusCode = 2 - TStatusCode_ERROR_STATUS TStatusCode = 3 - TStatusCode_INVALID_HANDLE_STATUS TStatusCode = 4 + TStatusCode_SUCCESS_STATUS TStatusCode = 0 + TStatusCode_SUCCESS_WITH_INFO_STATUS TStatusCode = 1 + TStatusCode_STILL_EXECUTING_STATUS TStatusCode = 2 + TStatusCode_ERROR_STATUS TStatusCode = 3 + TStatusCode_INVALID_HANDLE_STATUS TStatusCode = 4 ) func (p TStatusCode) String() string { - switch p { - case TStatusCode_SUCCESS_STATUS: - return "SUCCESS_STATUS" - case TStatusCode_SUCCESS_WITH_INFO_STATUS: - return "SUCCESS_WITH_INFO_STATUS" - case TStatusCode_STILL_EXECUTING_STATUS: - return "STILL_EXECUTING_STATUS" - case TStatusCode_ERROR_STATUS: - return "ERROR_STATUS" - case TStatusCode_INVALID_HANDLE_STATUS: - return "INVALID_HANDLE_STATUS" - } - return "" + switch p { + case TStatusCode_SUCCESS_STATUS: return "SUCCESS_STATUS" + case TStatusCode_SUCCESS_WITH_INFO_STATUS: return "SUCCESS_WITH_INFO_STATUS" + case TStatusCode_STILL_EXECUTING_STATUS: return "STILL_EXECUTING_STATUS" + case TStatusCode_ERROR_STATUS: return "ERROR_STATUS" + case TStatusCode_INVALID_HANDLE_STATUS: return "INVALID_HANDLE_STATUS" + } + return "" } func TStatusCodeFromString(s string) (TStatusCode, error) { - switch s { - case "SUCCESS_STATUS": - return TStatusCode_SUCCESS_STATUS, nil - case "SUCCESS_WITH_INFO_STATUS": - return TStatusCode_SUCCESS_WITH_INFO_STATUS, nil - case "STILL_EXECUTING_STATUS": - return TStatusCode_STILL_EXECUTING_STATUS, nil - case "ERROR_STATUS": - return TStatusCode_ERROR_STATUS, nil - case "INVALID_HANDLE_STATUS": - return TStatusCode_INVALID_HANDLE_STATUS, nil - } - return TStatusCode(0), fmt.Errorf("not a valid TStatusCode string") + switch s { + case "SUCCESS_STATUS": return TStatusCode_SUCCESS_STATUS, nil + case "SUCCESS_WITH_INFO_STATUS": return TStatusCode_SUCCESS_WITH_INFO_STATUS, nil + case "STILL_EXECUTING_STATUS": return TStatusCode_STILL_EXECUTING_STATUS, nil + case "ERROR_STATUS": return TStatusCode_ERROR_STATUS, nil + case "INVALID_HANDLE_STATUS": return TStatusCode_INVALID_HANDLE_STATUS, nil + } + return TStatusCode(0), fmt.Errorf("not a valid TStatusCode string") } + func TStatusCodePtr(v TStatusCode) *TStatusCode { return &v } func (p TStatusCode) MarshalText() ([]byte, error) { - return []byte(p.String()), nil +return []byte(p.String()), nil } func (p *TStatusCode) UnmarshalText(text []byte) error { - q, err := TStatusCodeFromString(string(text)) - if err != nil { - return err - } - *p = q - return nil +q, err := TStatusCodeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil } func (p *TStatusCode) Scan(value interface{}) error { - v, ok := value.(int64) - if !ok { - return errors.New("Scan value is not int64") - } - *p = TStatusCode(v) - return nil +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") } - -func (p *TStatusCode) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil +*p = TStatusCode(v) +return nil } +func (p * TStatusCode) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} type TOperationState int64 - const ( - TOperationState_INITIALIZED_STATE TOperationState = 0 - TOperationState_RUNNING_STATE TOperationState = 1 - TOperationState_FINISHED_STATE TOperationState = 2 - TOperationState_CANCELED_STATE TOperationState = 3 - TOperationState_CLOSED_STATE TOperationState = 4 - TOperationState_ERROR_STATE TOperationState = 5 - TOperationState_UKNOWN_STATE TOperationState = 6 - TOperationState_PENDING_STATE TOperationState = 7 - TOperationState_TIMEDOUT_STATE TOperationState = 8 + TOperationState_INITIALIZED_STATE TOperationState = 0 + TOperationState_RUNNING_STATE TOperationState = 1 + TOperationState_FINISHED_STATE TOperationState = 2 + TOperationState_CANCELED_STATE TOperationState = 3 + TOperationState_CLOSED_STATE TOperationState = 4 + TOperationState_ERROR_STATE TOperationState = 5 + TOperationState_UKNOWN_STATE TOperationState = 6 + TOperationState_PENDING_STATE TOperationState = 7 + TOperationState_TIMEDOUT_STATE TOperationState = 8 ) func (p TOperationState) String() string { - switch p { - case TOperationState_INITIALIZED_STATE: - return "INITIALIZED_STATE" - case TOperationState_RUNNING_STATE: - return "RUNNING_STATE" - case TOperationState_FINISHED_STATE: - return "FINISHED_STATE" - case TOperationState_CANCELED_STATE: - return "CANCELED_STATE" - case TOperationState_CLOSED_STATE: - return "CLOSED_STATE" - case TOperationState_ERROR_STATE: - return "ERROR_STATE" - case TOperationState_UKNOWN_STATE: - return "UKNOWN_STATE" - case TOperationState_PENDING_STATE: - return "PENDING_STATE" - case TOperationState_TIMEDOUT_STATE: - return "TIMEDOUT_STATE" - } - return "" + switch p { + case TOperationState_INITIALIZED_STATE: return "INITIALIZED_STATE" + case TOperationState_RUNNING_STATE: return "RUNNING_STATE" + case TOperationState_FINISHED_STATE: return "FINISHED_STATE" + case TOperationState_CANCELED_STATE: return "CANCELED_STATE" + case TOperationState_CLOSED_STATE: return "CLOSED_STATE" + case TOperationState_ERROR_STATE: return "ERROR_STATE" + case TOperationState_UKNOWN_STATE: return "UKNOWN_STATE" + case TOperationState_PENDING_STATE: return "PENDING_STATE" + case TOperationState_TIMEDOUT_STATE: return "TIMEDOUT_STATE" + } + return "" } func TOperationStateFromString(s string) (TOperationState, error) { - switch s { - case "INITIALIZED_STATE": - return TOperationState_INITIALIZED_STATE, nil - case "RUNNING_STATE": - return TOperationState_RUNNING_STATE, nil - case "FINISHED_STATE": - return TOperationState_FINISHED_STATE, nil - case "CANCELED_STATE": - return TOperationState_CANCELED_STATE, nil - case "CLOSED_STATE": - return TOperationState_CLOSED_STATE, nil - case "ERROR_STATE": - return TOperationState_ERROR_STATE, nil - case "UKNOWN_STATE": - return TOperationState_UKNOWN_STATE, nil - case "PENDING_STATE": - return TOperationState_PENDING_STATE, nil - case "TIMEDOUT_STATE": - return TOperationState_TIMEDOUT_STATE, nil - } - return TOperationState(0), fmt.Errorf("not a valid TOperationState string") + switch s { + case "INITIALIZED_STATE": return TOperationState_INITIALIZED_STATE, nil + case "RUNNING_STATE": return TOperationState_RUNNING_STATE, nil + case "FINISHED_STATE": return TOperationState_FINISHED_STATE, nil + case "CANCELED_STATE": return TOperationState_CANCELED_STATE, nil + case "CLOSED_STATE": return TOperationState_CLOSED_STATE, nil + case "ERROR_STATE": return TOperationState_ERROR_STATE, nil + case "UKNOWN_STATE": return TOperationState_UKNOWN_STATE, nil + case "PENDING_STATE": return TOperationState_PENDING_STATE, nil + case "TIMEDOUT_STATE": return TOperationState_TIMEDOUT_STATE, nil + } + return TOperationState(0), fmt.Errorf("not a valid TOperationState string") } + func TOperationStatePtr(v TOperationState) *TOperationState { return &v } func (p TOperationState) MarshalText() ([]byte, error) { - return []byte(p.String()), nil +return []byte(p.String()), nil } func (p *TOperationState) UnmarshalText(text []byte) error { - q, err := TOperationStateFromString(string(text)) - if err != nil { - return err - } - *p = q - return nil +q, err := TOperationStateFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil } func (p *TOperationState) Scan(value interface{}) error { - v, ok := value.(int64) - if !ok { - return errors.New("Scan value is not int64") - } - *p = TOperationState(v) - return nil +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") } - -func (p *TOperationState) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil +*p = TOperationState(v) +return nil } +func (p * TOperationState) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} type TOperationType int64 - const ( - TOperationType_EXECUTE_STATEMENT TOperationType = 0 - TOperationType_GET_TYPE_INFO TOperationType = 1 - TOperationType_GET_CATALOGS TOperationType = 2 - TOperationType_GET_SCHEMAS TOperationType = 3 - TOperationType_GET_TABLES TOperationType = 4 - TOperationType_GET_TABLE_TYPES TOperationType = 5 - TOperationType_GET_COLUMNS TOperationType = 6 - TOperationType_GET_FUNCTIONS TOperationType = 7 - TOperationType_UNKNOWN TOperationType = 8 + TOperationType_EXECUTE_STATEMENT TOperationType = 0 + TOperationType_GET_TYPE_INFO TOperationType = 1 + TOperationType_GET_CATALOGS TOperationType = 2 + TOperationType_GET_SCHEMAS TOperationType = 3 + TOperationType_GET_TABLES TOperationType = 4 + TOperationType_GET_TABLE_TYPES TOperationType = 5 + TOperationType_GET_COLUMNS TOperationType = 6 + TOperationType_GET_FUNCTIONS TOperationType = 7 + TOperationType_UNKNOWN TOperationType = 8 ) func (p TOperationType) String() string { - switch p { - case TOperationType_EXECUTE_STATEMENT: - return "EXECUTE_STATEMENT" - case TOperationType_GET_TYPE_INFO: - return "GET_TYPE_INFO" - case TOperationType_GET_CATALOGS: - return "GET_CATALOGS" - case TOperationType_GET_SCHEMAS: - return "GET_SCHEMAS" - case TOperationType_GET_TABLES: - return "GET_TABLES" - case TOperationType_GET_TABLE_TYPES: - return "GET_TABLE_TYPES" - case TOperationType_GET_COLUMNS: - return "GET_COLUMNS" - case TOperationType_GET_FUNCTIONS: - return "GET_FUNCTIONS" - case TOperationType_UNKNOWN: - return "UNKNOWN" - } - return "" + switch p { + case TOperationType_EXECUTE_STATEMENT: return "EXECUTE_STATEMENT" + case TOperationType_GET_TYPE_INFO: return "GET_TYPE_INFO" + case TOperationType_GET_CATALOGS: return "GET_CATALOGS" + case TOperationType_GET_SCHEMAS: return "GET_SCHEMAS" + case TOperationType_GET_TABLES: return "GET_TABLES" + case TOperationType_GET_TABLE_TYPES: return "GET_TABLE_TYPES" + case TOperationType_GET_COLUMNS: return "GET_COLUMNS" + case TOperationType_GET_FUNCTIONS: return "GET_FUNCTIONS" + case TOperationType_UNKNOWN: return "UNKNOWN" + } + return "" } func TOperationTypeFromString(s string) (TOperationType, error) { - switch s { - case "EXECUTE_STATEMENT": - return TOperationType_EXECUTE_STATEMENT, nil - case "GET_TYPE_INFO": - return TOperationType_GET_TYPE_INFO, nil - case "GET_CATALOGS": - return TOperationType_GET_CATALOGS, nil - case "GET_SCHEMAS": - return TOperationType_GET_SCHEMAS, nil - case "GET_TABLES": - return TOperationType_GET_TABLES, nil - case "GET_TABLE_TYPES": - return TOperationType_GET_TABLE_TYPES, nil - case "GET_COLUMNS": - return TOperationType_GET_COLUMNS, nil - case "GET_FUNCTIONS": - return TOperationType_GET_FUNCTIONS, nil - case "UNKNOWN": - return TOperationType_UNKNOWN, nil - } - return TOperationType(0), fmt.Errorf("not a valid TOperationType string") + switch s { + case "EXECUTE_STATEMENT": return TOperationType_EXECUTE_STATEMENT, nil + case "GET_TYPE_INFO": return TOperationType_GET_TYPE_INFO, nil + case "GET_CATALOGS": return TOperationType_GET_CATALOGS, nil + case "GET_SCHEMAS": return TOperationType_GET_SCHEMAS, nil + case "GET_TABLES": return TOperationType_GET_TABLES, nil + case "GET_TABLE_TYPES": return TOperationType_GET_TABLE_TYPES, nil + case "GET_COLUMNS": return TOperationType_GET_COLUMNS, nil + case "GET_FUNCTIONS": return TOperationType_GET_FUNCTIONS, nil + case "UNKNOWN": return TOperationType_UNKNOWN, nil + } + return TOperationType(0), fmt.Errorf("not a valid TOperationType string") } + func TOperationTypePtr(v TOperationType) *TOperationType { return &v } func (p TOperationType) MarshalText() ([]byte, error) { - return []byte(p.String()), nil +return []byte(p.String()), nil } func (p *TOperationType) UnmarshalText(text []byte) error { - q, err := TOperationTypeFromString(string(text)) - if err != nil { - return err - } - *p = q - return nil +q, err := TOperationTypeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil } func (p *TOperationType) Scan(value interface{}) error { - v, ok := value.(int64) - if !ok { - return errors.New("Scan value is not int64") - } - *p = TOperationType(v) - return nil +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") } - -func (p *TOperationType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil +*p = TOperationType(v) +return nil } +func (p * TOperationType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} type TGetInfoType int64 - const ( - TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS TGetInfoType = 0 - TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES TGetInfoType = 1 - TGetInfoType_CLI_DATA_SOURCE_NAME TGetInfoType = 2 - TGetInfoType_CLI_FETCH_DIRECTION TGetInfoType = 8 - TGetInfoType_CLI_SERVER_NAME TGetInfoType = 13 - TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE TGetInfoType = 14 - TGetInfoType_CLI_DBMS_NAME TGetInfoType = 17 - TGetInfoType_CLI_DBMS_VER TGetInfoType = 18 - TGetInfoType_CLI_ACCESSIBLE_TABLES TGetInfoType = 19 - TGetInfoType_CLI_ACCESSIBLE_PROCEDURES TGetInfoType = 20 - TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR TGetInfoType = 23 - TGetInfoType_CLI_DATA_SOURCE_READ_ONLY TGetInfoType = 25 - TGetInfoType_CLI_DEFAULT_TXN_ISOLATION TGetInfoType = 26 - TGetInfoType_CLI_IDENTIFIER_CASE TGetInfoType = 28 - TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR TGetInfoType = 29 - TGetInfoType_CLI_MAX_COLUMN_NAME_LEN TGetInfoType = 30 - TGetInfoType_CLI_MAX_CURSOR_NAME_LEN TGetInfoType = 31 - TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN TGetInfoType = 32 - TGetInfoType_CLI_MAX_CATALOG_NAME_LEN TGetInfoType = 34 - TGetInfoType_CLI_MAX_TABLE_NAME_LEN TGetInfoType = 35 - TGetInfoType_CLI_SCROLL_CONCURRENCY TGetInfoType = 43 - TGetInfoType_CLI_TXN_CAPABLE TGetInfoType = 46 - TGetInfoType_CLI_USER_NAME TGetInfoType = 47 - TGetInfoType_CLI_TXN_ISOLATION_OPTION TGetInfoType = 72 - TGetInfoType_CLI_INTEGRITY TGetInfoType = 73 - TGetInfoType_CLI_GETDATA_EXTENSIONS TGetInfoType = 81 - TGetInfoType_CLI_NULL_COLLATION TGetInfoType = 85 - TGetInfoType_CLI_ALTER_TABLE TGetInfoType = 86 - TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT TGetInfoType = 90 - TGetInfoType_CLI_SPECIAL_CHARACTERS TGetInfoType = 94 - TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY TGetInfoType = 97 - TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX TGetInfoType = 98 - TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY TGetInfoType = 99 - TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT TGetInfoType = 100 - TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE TGetInfoType = 101 - TGetInfoType_CLI_MAX_INDEX_SIZE TGetInfoType = 102 - TGetInfoType_CLI_MAX_ROW_SIZE TGetInfoType = 104 - TGetInfoType_CLI_MAX_STATEMENT_LEN TGetInfoType = 105 - TGetInfoType_CLI_MAX_TABLES_IN_SELECT TGetInfoType = 106 - TGetInfoType_CLI_MAX_USER_NAME_LEN TGetInfoType = 107 - TGetInfoType_CLI_OJ_CAPABILITIES TGetInfoType = 115 - TGetInfoType_CLI_XOPEN_CLI_YEAR TGetInfoType = 10000 - TGetInfoType_CLI_CURSOR_SENSITIVITY TGetInfoType = 10001 - TGetInfoType_CLI_DESCRIBE_PARAMETER TGetInfoType = 10002 - TGetInfoType_CLI_CATALOG_NAME TGetInfoType = 10003 - TGetInfoType_CLI_COLLATION_SEQ TGetInfoType = 10004 - TGetInfoType_CLI_MAX_IDENTIFIER_LEN TGetInfoType = 10005 + TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS TGetInfoType = 0 + TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES TGetInfoType = 1 + TGetInfoType_CLI_DATA_SOURCE_NAME TGetInfoType = 2 + TGetInfoType_CLI_FETCH_DIRECTION TGetInfoType = 8 + TGetInfoType_CLI_SERVER_NAME TGetInfoType = 13 + TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE TGetInfoType = 14 + TGetInfoType_CLI_DBMS_NAME TGetInfoType = 17 + TGetInfoType_CLI_DBMS_VER TGetInfoType = 18 + TGetInfoType_CLI_ACCESSIBLE_TABLES TGetInfoType = 19 + TGetInfoType_CLI_ACCESSIBLE_PROCEDURES TGetInfoType = 20 + TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR TGetInfoType = 23 + TGetInfoType_CLI_DATA_SOURCE_READ_ONLY TGetInfoType = 25 + TGetInfoType_CLI_DEFAULT_TXN_ISOLATION TGetInfoType = 26 + TGetInfoType_CLI_IDENTIFIER_CASE TGetInfoType = 28 + TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR TGetInfoType = 29 + TGetInfoType_CLI_MAX_COLUMN_NAME_LEN TGetInfoType = 30 + TGetInfoType_CLI_MAX_CURSOR_NAME_LEN TGetInfoType = 31 + TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN TGetInfoType = 32 + TGetInfoType_CLI_MAX_CATALOG_NAME_LEN TGetInfoType = 34 + TGetInfoType_CLI_MAX_TABLE_NAME_LEN TGetInfoType = 35 + TGetInfoType_CLI_SCROLL_CONCURRENCY TGetInfoType = 43 + TGetInfoType_CLI_TXN_CAPABLE TGetInfoType = 46 + TGetInfoType_CLI_USER_NAME TGetInfoType = 47 + TGetInfoType_CLI_TXN_ISOLATION_OPTION TGetInfoType = 72 + TGetInfoType_CLI_INTEGRITY TGetInfoType = 73 + TGetInfoType_CLI_GETDATA_EXTENSIONS TGetInfoType = 81 + TGetInfoType_CLI_NULL_COLLATION TGetInfoType = 85 + TGetInfoType_CLI_ALTER_TABLE TGetInfoType = 86 + TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT TGetInfoType = 90 + TGetInfoType_CLI_SPECIAL_CHARACTERS TGetInfoType = 94 + TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY TGetInfoType = 97 + TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX TGetInfoType = 98 + TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY TGetInfoType = 99 + TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT TGetInfoType = 100 + TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE TGetInfoType = 101 + TGetInfoType_CLI_MAX_INDEX_SIZE TGetInfoType = 102 + TGetInfoType_CLI_MAX_ROW_SIZE TGetInfoType = 104 + TGetInfoType_CLI_MAX_STATEMENT_LEN TGetInfoType = 105 + TGetInfoType_CLI_MAX_TABLES_IN_SELECT TGetInfoType = 106 + TGetInfoType_CLI_MAX_USER_NAME_LEN TGetInfoType = 107 + TGetInfoType_CLI_OJ_CAPABILITIES TGetInfoType = 115 + TGetInfoType_CLI_XOPEN_CLI_YEAR TGetInfoType = 10000 + TGetInfoType_CLI_CURSOR_SENSITIVITY TGetInfoType = 10001 + TGetInfoType_CLI_DESCRIBE_PARAMETER TGetInfoType = 10002 + TGetInfoType_CLI_CATALOG_NAME TGetInfoType = 10003 + TGetInfoType_CLI_COLLATION_SEQ TGetInfoType = 10004 + TGetInfoType_CLI_MAX_IDENTIFIER_LEN TGetInfoType = 10005 ) func (p TGetInfoType) String() string { - switch p { - case TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS: - return "CLI_MAX_DRIVER_CONNECTIONS" - case TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES: - return "CLI_MAX_CONCURRENT_ACTIVITIES" - case TGetInfoType_CLI_DATA_SOURCE_NAME: - return "CLI_DATA_SOURCE_NAME" - case TGetInfoType_CLI_FETCH_DIRECTION: - return "CLI_FETCH_DIRECTION" - case TGetInfoType_CLI_SERVER_NAME: - return "CLI_SERVER_NAME" - case TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE: - return "CLI_SEARCH_PATTERN_ESCAPE" - case TGetInfoType_CLI_DBMS_NAME: - return "CLI_DBMS_NAME" - case TGetInfoType_CLI_DBMS_VER: - return "CLI_DBMS_VER" - case TGetInfoType_CLI_ACCESSIBLE_TABLES: - return "CLI_ACCESSIBLE_TABLES" - case TGetInfoType_CLI_ACCESSIBLE_PROCEDURES: - return "CLI_ACCESSIBLE_PROCEDURES" - case TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR: - return "CLI_CURSOR_COMMIT_BEHAVIOR" - case TGetInfoType_CLI_DATA_SOURCE_READ_ONLY: - return "CLI_DATA_SOURCE_READ_ONLY" - case TGetInfoType_CLI_DEFAULT_TXN_ISOLATION: - return "CLI_DEFAULT_TXN_ISOLATION" - case TGetInfoType_CLI_IDENTIFIER_CASE: - return "CLI_IDENTIFIER_CASE" - case TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR: - return "CLI_IDENTIFIER_QUOTE_CHAR" - case TGetInfoType_CLI_MAX_COLUMN_NAME_LEN: - return "CLI_MAX_COLUMN_NAME_LEN" - case TGetInfoType_CLI_MAX_CURSOR_NAME_LEN: - return "CLI_MAX_CURSOR_NAME_LEN" - case TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN: - return "CLI_MAX_SCHEMA_NAME_LEN" - case TGetInfoType_CLI_MAX_CATALOG_NAME_LEN: - return "CLI_MAX_CATALOG_NAME_LEN" - case TGetInfoType_CLI_MAX_TABLE_NAME_LEN: - return "CLI_MAX_TABLE_NAME_LEN" - case TGetInfoType_CLI_SCROLL_CONCURRENCY: - return "CLI_SCROLL_CONCURRENCY" - case TGetInfoType_CLI_TXN_CAPABLE: - return "CLI_TXN_CAPABLE" - case TGetInfoType_CLI_USER_NAME: - return "CLI_USER_NAME" - case TGetInfoType_CLI_TXN_ISOLATION_OPTION: - return "CLI_TXN_ISOLATION_OPTION" - case TGetInfoType_CLI_INTEGRITY: - return "CLI_INTEGRITY" - case TGetInfoType_CLI_GETDATA_EXTENSIONS: - return "CLI_GETDATA_EXTENSIONS" - case TGetInfoType_CLI_NULL_COLLATION: - return "CLI_NULL_COLLATION" - case TGetInfoType_CLI_ALTER_TABLE: - return "CLI_ALTER_TABLE" - case TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT: - return "CLI_ORDER_BY_COLUMNS_IN_SELECT" - case TGetInfoType_CLI_SPECIAL_CHARACTERS: - return "CLI_SPECIAL_CHARACTERS" - case TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY: - return "CLI_MAX_COLUMNS_IN_GROUP_BY" - case TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX: - return "CLI_MAX_COLUMNS_IN_INDEX" - case TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY: - return "CLI_MAX_COLUMNS_IN_ORDER_BY" - case TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT: - return "CLI_MAX_COLUMNS_IN_SELECT" - case TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE: - return "CLI_MAX_COLUMNS_IN_TABLE" - case TGetInfoType_CLI_MAX_INDEX_SIZE: - return "CLI_MAX_INDEX_SIZE" - case TGetInfoType_CLI_MAX_ROW_SIZE: - return "CLI_MAX_ROW_SIZE" - case TGetInfoType_CLI_MAX_STATEMENT_LEN: - return "CLI_MAX_STATEMENT_LEN" - case TGetInfoType_CLI_MAX_TABLES_IN_SELECT: - return "CLI_MAX_TABLES_IN_SELECT" - case TGetInfoType_CLI_MAX_USER_NAME_LEN: - return "CLI_MAX_USER_NAME_LEN" - case TGetInfoType_CLI_OJ_CAPABILITIES: - return "CLI_OJ_CAPABILITIES" - case TGetInfoType_CLI_XOPEN_CLI_YEAR: - return "CLI_XOPEN_CLI_YEAR" - case TGetInfoType_CLI_CURSOR_SENSITIVITY: - return "CLI_CURSOR_SENSITIVITY" - case TGetInfoType_CLI_DESCRIBE_PARAMETER: - return "CLI_DESCRIBE_PARAMETER" - case TGetInfoType_CLI_CATALOG_NAME: - return "CLI_CATALOG_NAME" - case TGetInfoType_CLI_COLLATION_SEQ: - return "CLI_COLLATION_SEQ" - case TGetInfoType_CLI_MAX_IDENTIFIER_LEN: - return "CLI_MAX_IDENTIFIER_LEN" - } - return "" + switch p { + case TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS: return "CLI_MAX_DRIVER_CONNECTIONS" + case TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES: return "CLI_MAX_CONCURRENT_ACTIVITIES" + case TGetInfoType_CLI_DATA_SOURCE_NAME: return "CLI_DATA_SOURCE_NAME" + case TGetInfoType_CLI_FETCH_DIRECTION: return "CLI_FETCH_DIRECTION" + case TGetInfoType_CLI_SERVER_NAME: return "CLI_SERVER_NAME" + case TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE: return "CLI_SEARCH_PATTERN_ESCAPE" + case TGetInfoType_CLI_DBMS_NAME: return "CLI_DBMS_NAME" + case TGetInfoType_CLI_DBMS_VER: return "CLI_DBMS_VER" + case TGetInfoType_CLI_ACCESSIBLE_TABLES: return "CLI_ACCESSIBLE_TABLES" + case TGetInfoType_CLI_ACCESSIBLE_PROCEDURES: return "CLI_ACCESSIBLE_PROCEDURES" + case TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR: return "CLI_CURSOR_COMMIT_BEHAVIOR" + case TGetInfoType_CLI_DATA_SOURCE_READ_ONLY: return "CLI_DATA_SOURCE_READ_ONLY" + case TGetInfoType_CLI_DEFAULT_TXN_ISOLATION: return "CLI_DEFAULT_TXN_ISOLATION" + case TGetInfoType_CLI_IDENTIFIER_CASE: return "CLI_IDENTIFIER_CASE" + case TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR: return "CLI_IDENTIFIER_QUOTE_CHAR" + case TGetInfoType_CLI_MAX_COLUMN_NAME_LEN: return "CLI_MAX_COLUMN_NAME_LEN" + case TGetInfoType_CLI_MAX_CURSOR_NAME_LEN: return "CLI_MAX_CURSOR_NAME_LEN" + case TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN: return "CLI_MAX_SCHEMA_NAME_LEN" + case TGetInfoType_CLI_MAX_CATALOG_NAME_LEN: return "CLI_MAX_CATALOG_NAME_LEN" + case TGetInfoType_CLI_MAX_TABLE_NAME_LEN: return "CLI_MAX_TABLE_NAME_LEN" + case TGetInfoType_CLI_SCROLL_CONCURRENCY: return "CLI_SCROLL_CONCURRENCY" + case TGetInfoType_CLI_TXN_CAPABLE: return "CLI_TXN_CAPABLE" + case TGetInfoType_CLI_USER_NAME: return "CLI_USER_NAME" + case TGetInfoType_CLI_TXN_ISOLATION_OPTION: return "CLI_TXN_ISOLATION_OPTION" + case TGetInfoType_CLI_INTEGRITY: return "CLI_INTEGRITY" + case TGetInfoType_CLI_GETDATA_EXTENSIONS: return "CLI_GETDATA_EXTENSIONS" + case TGetInfoType_CLI_NULL_COLLATION: return "CLI_NULL_COLLATION" + case TGetInfoType_CLI_ALTER_TABLE: return "CLI_ALTER_TABLE" + case TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT: return "CLI_ORDER_BY_COLUMNS_IN_SELECT" + case TGetInfoType_CLI_SPECIAL_CHARACTERS: return "CLI_SPECIAL_CHARACTERS" + case TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY: return "CLI_MAX_COLUMNS_IN_GROUP_BY" + case TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX: return "CLI_MAX_COLUMNS_IN_INDEX" + case TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY: return "CLI_MAX_COLUMNS_IN_ORDER_BY" + case TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT: return "CLI_MAX_COLUMNS_IN_SELECT" + case TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE: return "CLI_MAX_COLUMNS_IN_TABLE" + case TGetInfoType_CLI_MAX_INDEX_SIZE: return "CLI_MAX_INDEX_SIZE" + case TGetInfoType_CLI_MAX_ROW_SIZE: return "CLI_MAX_ROW_SIZE" + case TGetInfoType_CLI_MAX_STATEMENT_LEN: return "CLI_MAX_STATEMENT_LEN" + case TGetInfoType_CLI_MAX_TABLES_IN_SELECT: return "CLI_MAX_TABLES_IN_SELECT" + case TGetInfoType_CLI_MAX_USER_NAME_LEN: return "CLI_MAX_USER_NAME_LEN" + case TGetInfoType_CLI_OJ_CAPABILITIES: return "CLI_OJ_CAPABILITIES" + case TGetInfoType_CLI_XOPEN_CLI_YEAR: return "CLI_XOPEN_CLI_YEAR" + case TGetInfoType_CLI_CURSOR_SENSITIVITY: return "CLI_CURSOR_SENSITIVITY" + case TGetInfoType_CLI_DESCRIBE_PARAMETER: return "CLI_DESCRIBE_PARAMETER" + case TGetInfoType_CLI_CATALOG_NAME: return "CLI_CATALOG_NAME" + case TGetInfoType_CLI_COLLATION_SEQ: return "CLI_COLLATION_SEQ" + case TGetInfoType_CLI_MAX_IDENTIFIER_LEN: return "CLI_MAX_IDENTIFIER_LEN" + } + return "" } func TGetInfoTypeFromString(s string) (TGetInfoType, error) { - switch s { - case "CLI_MAX_DRIVER_CONNECTIONS": - return TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS, nil - case "CLI_MAX_CONCURRENT_ACTIVITIES": - return TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES, nil - case "CLI_DATA_SOURCE_NAME": - return TGetInfoType_CLI_DATA_SOURCE_NAME, nil - case "CLI_FETCH_DIRECTION": - return TGetInfoType_CLI_FETCH_DIRECTION, nil - case "CLI_SERVER_NAME": - return TGetInfoType_CLI_SERVER_NAME, nil - case "CLI_SEARCH_PATTERN_ESCAPE": - return TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE, nil - case "CLI_DBMS_NAME": - return TGetInfoType_CLI_DBMS_NAME, nil - case "CLI_DBMS_VER": - return TGetInfoType_CLI_DBMS_VER, nil - case "CLI_ACCESSIBLE_TABLES": - return TGetInfoType_CLI_ACCESSIBLE_TABLES, nil - case "CLI_ACCESSIBLE_PROCEDURES": - return TGetInfoType_CLI_ACCESSIBLE_PROCEDURES, nil - case "CLI_CURSOR_COMMIT_BEHAVIOR": - return TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR, nil - case "CLI_DATA_SOURCE_READ_ONLY": - return TGetInfoType_CLI_DATA_SOURCE_READ_ONLY, nil - case "CLI_DEFAULT_TXN_ISOLATION": - return TGetInfoType_CLI_DEFAULT_TXN_ISOLATION, nil - case "CLI_IDENTIFIER_CASE": - return TGetInfoType_CLI_IDENTIFIER_CASE, nil - case "CLI_IDENTIFIER_QUOTE_CHAR": - return TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR, nil - case "CLI_MAX_COLUMN_NAME_LEN": - return TGetInfoType_CLI_MAX_COLUMN_NAME_LEN, nil - case "CLI_MAX_CURSOR_NAME_LEN": - return TGetInfoType_CLI_MAX_CURSOR_NAME_LEN, nil - case "CLI_MAX_SCHEMA_NAME_LEN": - return TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN, nil - case "CLI_MAX_CATALOG_NAME_LEN": - return TGetInfoType_CLI_MAX_CATALOG_NAME_LEN, nil - case "CLI_MAX_TABLE_NAME_LEN": - return TGetInfoType_CLI_MAX_TABLE_NAME_LEN, nil - case "CLI_SCROLL_CONCURRENCY": - return TGetInfoType_CLI_SCROLL_CONCURRENCY, nil - case "CLI_TXN_CAPABLE": - return TGetInfoType_CLI_TXN_CAPABLE, nil - case "CLI_USER_NAME": - return TGetInfoType_CLI_USER_NAME, nil - case "CLI_TXN_ISOLATION_OPTION": - return TGetInfoType_CLI_TXN_ISOLATION_OPTION, nil - case "CLI_INTEGRITY": - return TGetInfoType_CLI_INTEGRITY, nil - case "CLI_GETDATA_EXTENSIONS": - return TGetInfoType_CLI_GETDATA_EXTENSIONS, nil - case "CLI_NULL_COLLATION": - return TGetInfoType_CLI_NULL_COLLATION, nil - case "CLI_ALTER_TABLE": - return TGetInfoType_CLI_ALTER_TABLE, nil - case "CLI_ORDER_BY_COLUMNS_IN_SELECT": - return TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT, nil - case "CLI_SPECIAL_CHARACTERS": - return TGetInfoType_CLI_SPECIAL_CHARACTERS, nil - case "CLI_MAX_COLUMNS_IN_GROUP_BY": - return TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY, nil - case "CLI_MAX_COLUMNS_IN_INDEX": - return TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX, nil - case "CLI_MAX_COLUMNS_IN_ORDER_BY": - return TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY, nil - case "CLI_MAX_COLUMNS_IN_SELECT": - return TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT, nil - case "CLI_MAX_COLUMNS_IN_TABLE": - return TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE, nil - case "CLI_MAX_INDEX_SIZE": - return TGetInfoType_CLI_MAX_INDEX_SIZE, nil - case "CLI_MAX_ROW_SIZE": - return TGetInfoType_CLI_MAX_ROW_SIZE, nil - case "CLI_MAX_STATEMENT_LEN": - return TGetInfoType_CLI_MAX_STATEMENT_LEN, nil - case "CLI_MAX_TABLES_IN_SELECT": - return TGetInfoType_CLI_MAX_TABLES_IN_SELECT, nil - case "CLI_MAX_USER_NAME_LEN": - return TGetInfoType_CLI_MAX_USER_NAME_LEN, nil - case "CLI_OJ_CAPABILITIES": - return TGetInfoType_CLI_OJ_CAPABILITIES, nil - case "CLI_XOPEN_CLI_YEAR": - return TGetInfoType_CLI_XOPEN_CLI_YEAR, nil - case "CLI_CURSOR_SENSITIVITY": - return TGetInfoType_CLI_CURSOR_SENSITIVITY, nil - case "CLI_DESCRIBE_PARAMETER": - return TGetInfoType_CLI_DESCRIBE_PARAMETER, nil - case "CLI_CATALOG_NAME": - return TGetInfoType_CLI_CATALOG_NAME, nil - case "CLI_COLLATION_SEQ": - return TGetInfoType_CLI_COLLATION_SEQ, nil - case "CLI_MAX_IDENTIFIER_LEN": - return TGetInfoType_CLI_MAX_IDENTIFIER_LEN, nil - } - return TGetInfoType(0), fmt.Errorf("not a valid TGetInfoType string") + switch s { + case "CLI_MAX_DRIVER_CONNECTIONS": return TGetInfoType_CLI_MAX_DRIVER_CONNECTIONS, nil + case "CLI_MAX_CONCURRENT_ACTIVITIES": return TGetInfoType_CLI_MAX_CONCURRENT_ACTIVITIES, nil + case "CLI_DATA_SOURCE_NAME": return TGetInfoType_CLI_DATA_SOURCE_NAME, nil + case "CLI_FETCH_DIRECTION": return TGetInfoType_CLI_FETCH_DIRECTION, nil + case "CLI_SERVER_NAME": return TGetInfoType_CLI_SERVER_NAME, nil + case "CLI_SEARCH_PATTERN_ESCAPE": return TGetInfoType_CLI_SEARCH_PATTERN_ESCAPE, nil + case "CLI_DBMS_NAME": return TGetInfoType_CLI_DBMS_NAME, nil + case "CLI_DBMS_VER": return TGetInfoType_CLI_DBMS_VER, nil + case "CLI_ACCESSIBLE_TABLES": return TGetInfoType_CLI_ACCESSIBLE_TABLES, nil + case "CLI_ACCESSIBLE_PROCEDURES": return TGetInfoType_CLI_ACCESSIBLE_PROCEDURES, nil + case "CLI_CURSOR_COMMIT_BEHAVIOR": return TGetInfoType_CLI_CURSOR_COMMIT_BEHAVIOR, nil + case "CLI_DATA_SOURCE_READ_ONLY": return TGetInfoType_CLI_DATA_SOURCE_READ_ONLY, nil + case "CLI_DEFAULT_TXN_ISOLATION": return TGetInfoType_CLI_DEFAULT_TXN_ISOLATION, nil + case "CLI_IDENTIFIER_CASE": return TGetInfoType_CLI_IDENTIFIER_CASE, nil + case "CLI_IDENTIFIER_QUOTE_CHAR": return TGetInfoType_CLI_IDENTIFIER_QUOTE_CHAR, nil + case "CLI_MAX_COLUMN_NAME_LEN": return TGetInfoType_CLI_MAX_COLUMN_NAME_LEN, nil + case "CLI_MAX_CURSOR_NAME_LEN": return TGetInfoType_CLI_MAX_CURSOR_NAME_LEN, nil + case "CLI_MAX_SCHEMA_NAME_LEN": return TGetInfoType_CLI_MAX_SCHEMA_NAME_LEN, nil + case "CLI_MAX_CATALOG_NAME_LEN": return TGetInfoType_CLI_MAX_CATALOG_NAME_LEN, nil + case "CLI_MAX_TABLE_NAME_LEN": return TGetInfoType_CLI_MAX_TABLE_NAME_LEN, nil + case "CLI_SCROLL_CONCURRENCY": return TGetInfoType_CLI_SCROLL_CONCURRENCY, nil + case "CLI_TXN_CAPABLE": return TGetInfoType_CLI_TXN_CAPABLE, nil + case "CLI_USER_NAME": return TGetInfoType_CLI_USER_NAME, nil + case "CLI_TXN_ISOLATION_OPTION": return TGetInfoType_CLI_TXN_ISOLATION_OPTION, nil + case "CLI_INTEGRITY": return TGetInfoType_CLI_INTEGRITY, nil + case "CLI_GETDATA_EXTENSIONS": return TGetInfoType_CLI_GETDATA_EXTENSIONS, nil + case "CLI_NULL_COLLATION": return TGetInfoType_CLI_NULL_COLLATION, nil + case "CLI_ALTER_TABLE": return TGetInfoType_CLI_ALTER_TABLE, nil + case "CLI_ORDER_BY_COLUMNS_IN_SELECT": return TGetInfoType_CLI_ORDER_BY_COLUMNS_IN_SELECT, nil + case "CLI_SPECIAL_CHARACTERS": return TGetInfoType_CLI_SPECIAL_CHARACTERS, nil + case "CLI_MAX_COLUMNS_IN_GROUP_BY": return TGetInfoType_CLI_MAX_COLUMNS_IN_GROUP_BY, nil + case "CLI_MAX_COLUMNS_IN_INDEX": return TGetInfoType_CLI_MAX_COLUMNS_IN_INDEX, nil + case "CLI_MAX_COLUMNS_IN_ORDER_BY": return TGetInfoType_CLI_MAX_COLUMNS_IN_ORDER_BY, nil + case "CLI_MAX_COLUMNS_IN_SELECT": return TGetInfoType_CLI_MAX_COLUMNS_IN_SELECT, nil + case "CLI_MAX_COLUMNS_IN_TABLE": return TGetInfoType_CLI_MAX_COLUMNS_IN_TABLE, nil + case "CLI_MAX_INDEX_SIZE": return TGetInfoType_CLI_MAX_INDEX_SIZE, nil + case "CLI_MAX_ROW_SIZE": return TGetInfoType_CLI_MAX_ROW_SIZE, nil + case "CLI_MAX_STATEMENT_LEN": return TGetInfoType_CLI_MAX_STATEMENT_LEN, nil + case "CLI_MAX_TABLES_IN_SELECT": return TGetInfoType_CLI_MAX_TABLES_IN_SELECT, nil + case "CLI_MAX_USER_NAME_LEN": return TGetInfoType_CLI_MAX_USER_NAME_LEN, nil + case "CLI_OJ_CAPABILITIES": return TGetInfoType_CLI_OJ_CAPABILITIES, nil + case "CLI_XOPEN_CLI_YEAR": return TGetInfoType_CLI_XOPEN_CLI_YEAR, nil + case "CLI_CURSOR_SENSITIVITY": return TGetInfoType_CLI_CURSOR_SENSITIVITY, nil + case "CLI_DESCRIBE_PARAMETER": return TGetInfoType_CLI_DESCRIBE_PARAMETER, nil + case "CLI_CATALOG_NAME": return TGetInfoType_CLI_CATALOG_NAME, nil + case "CLI_COLLATION_SEQ": return TGetInfoType_CLI_COLLATION_SEQ, nil + case "CLI_MAX_IDENTIFIER_LEN": return TGetInfoType_CLI_MAX_IDENTIFIER_LEN, nil + } + return TGetInfoType(0), fmt.Errorf("not a valid TGetInfoType string") } + func TGetInfoTypePtr(v TGetInfoType) *TGetInfoType { return &v } func (p TGetInfoType) MarshalText() ([]byte, error) { - return []byte(p.String()), nil +return []byte(p.String()), nil } func (p *TGetInfoType) UnmarshalText(text []byte) error { - q, err := TGetInfoTypeFromString(string(text)) - if err != nil { - return err - } - *p = q - return nil +q, err := TGetInfoTypeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil } func (p *TGetInfoType) Scan(value interface{}) error { - v, ok := value.(int64) - if !ok { - return errors.New("Scan value is not int64") - } - *p = TGetInfoType(v) - return nil +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") } - -func (p *TGetInfoType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil +*p = TGetInfoType(v) +return nil } +func (p * TGetInfoType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} type TCacheLookupResult_ int64 - const ( - TCacheLookupResult__CACHE_INELIGIBLE TCacheLookupResult_ = 0 - TCacheLookupResult__LOCAL_CACHE_HIT TCacheLookupResult_ = 1 - TCacheLookupResult__REMOTE_CACHE_HIT TCacheLookupResult_ = 2 - TCacheLookupResult__CACHE_MISS TCacheLookupResult_ = 3 + TCacheLookupResult__CACHE_INELIGIBLE TCacheLookupResult_ = 0 + TCacheLookupResult__LOCAL_CACHE_HIT TCacheLookupResult_ = 1 + TCacheLookupResult__REMOTE_CACHE_HIT TCacheLookupResult_ = 2 + TCacheLookupResult__CACHE_MISS TCacheLookupResult_ = 3 ) func (p TCacheLookupResult_) String() string { - switch p { - case TCacheLookupResult__CACHE_INELIGIBLE: - return "CACHE_INELIGIBLE" - case TCacheLookupResult__LOCAL_CACHE_HIT: - return "LOCAL_CACHE_HIT" - case TCacheLookupResult__REMOTE_CACHE_HIT: - return "REMOTE_CACHE_HIT" - case TCacheLookupResult__CACHE_MISS: - return "CACHE_MISS" - } - return "" + switch p { + case TCacheLookupResult__CACHE_INELIGIBLE: return "CACHE_INELIGIBLE" + case TCacheLookupResult__LOCAL_CACHE_HIT: return "LOCAL_CACHE_HIT" + case TCacheLookupResult__REMOTE_CACHE_HIT: return "REMOTE_CACHE_HIT" + case TCacheLookupResult__CACHE_MISS: return "CACHE_MISS" + } + return "" } func TCacheLookupResult_FromString(s string) (TCacheLookupResult_, error) { - switch s { - case "CACHE_INELIGIBLE": - return TCacheLookupResult__CACHE_INELIGIBLE, nil - case "LOCAL_CACHE_HIT": - return TCacheLookupResult__LOCAL_CACHE_HIT, nil - case "REMOTE_CACHE_HIT": - return TCacheLookupResult__REMOTE_CACHE_HIT, nil - case "CACHE_MISS": - return TCacheLookupResult__CACHE_MISS, nil - } - return TCacheLookupResult_(0), fmt.Errorf("not a valid TCacheLookupResult_ string") + switch s { + case "CACHE_INELIGIBLE": return TCacheLookupResult__CACHE_INELIGIBLE, nil + case "LOCAL_CACHE_HIT": return TCacheLookupResult__LOCAL_CACHE_HIT, nil + case "REMOTE_CACHE_HIT": return TCacheLookupResult__REMOTE_CACHE_HIT, nil + case "CACHE_MISS": return TCacheLookupResult__CACHE_MISS, nil + } + return TCacheLookupResult_(0), fmt.Errorf("not a valid TCacheLookupResult_ string") } + func TCacheLookupResult_Ptr(v TCacheLookupResult_) *TCacheLookupResult_ { return &v } func (p TCacheLookupResult_) MarshalText() ([]byte, error) { - return []byte(p.String()), nil +return []byte(p.String()), nil } func (p *TCacheLookupResult_) UnmarshalText(text []byte) error { - q, err := TCacheLookupResult_FromString(string(text)) - if err != nil { - return err - } - *p = q - return nil +q, err := TCacheLookupResult_FromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil } func (p *TCacheLookupResult_) Scan(value interface{}) error { - v, ok := value.(int64) - if !ok { - return errors.New("Scan value is not int64") - } - *p = TCacheLookupResult_(v) - return nil +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") } - -func (p *TCacheLookupResult_) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil +*p = TCacheLookupResult_(v) +return nil } +func (p * TCacheLookupResult_) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} type TFetchOrientation int64 - const ( - TFetchOrientation_FETCH_NEXT TFetchOrientation = 0 - TFetchOrientation_FETCH_PRIOR TFetchOrientation = 1 - TFetchOrientation_FETCH_RELATIVE TFetchOrientation = 2 - TFetchOrientation_FETCH_ABSOLUTE TFetchOrientation = 3 - TFetchOrientation_FETCH_FIRST TFetchOrientation = 4 - TFetchOrientation_FETCH_LAST TFetchOrientation = 5 + TFetchOrientation_FETCH_NEXT TFetchOrientation = 0 + TFetchOrientation_FETCH_PRIOR TFetchOrientation = 1 + TFetchOrientation_FETCH_RELATIVE TFetchOrientation = 2 + TFetchOrientation_FETCH_ABSOLUTE TFetchOrientation = 3 + TFetchOrientation_FETCH_FIRST TFetchOrientation = 4 + TFetchOrientation_FETCH_LAST TFetchOrientation = 5 ) func (p TFetchOrientation) String() string { - switch p { - case TFetchOrientation_FETCH_NEXT: - return "FETCH_NEXT" - case TFetchOrientation_FETCH_PRIOR: - return "FETCH_PRIOR" - case TFetchOrientation_FETCH_RELATIVE: - return "FETCH_RELATIVE" - case TFetchOrientation_FETCH_ABSOLUTE: - return "FETCH_ABSOLUTE" - case TFetchOrientation_FETCH_FIRST: - return "FETCH_FIRST" - case TFetchOrientation_FETCH_LAST: - return "FETCH_LAST" - } - return "" + switch p { + case TFetchOrientation_FETCH_NEXT: return "FETCH_NEXT" + case TFetchOrientation_FETCH_PRIOR: return "FETCH_PRIOR" + case TFetchOrientation_FETCH_RELATIVE: return "FETCH_RELATIVE" + case TFetchOrientation_FETCH_ABSOLUTE: return "FETCH_ABSOLUTE" + case TFetchOrientation_FETCH_FIRST: return "FETCH_FIRST" + case TFetchOrientation_FETCH_LAST: return "FETCH_LAST" + } + return "" } func TFetchOrientationFromString(s string) (TFetchOrientation, error) { - switch s { - case "FETCH_NEXT": - return TFetchOrientation_FETCH_NEXT, nil - case "FETCH_PRIOR": - return TFetchOrientation_FETCH_PRIOR, nil - case "FETCH_RELATIVE": - return TFetchOrientation_FETCH_RELATIVE, nil - case "FETCH_ABSOLUTE": - return TFetchOrientation_FETCH_ABSOLUTE, nil - case "FETCH_FIRST": - return TFetchOrientation_FETCH_FIRST, nil - case "FETCH_LAST": - return TFetchOrientation_FETCH_LAST, nil - } - return TFetchOrientation(0), fmt.Errorf("not a valid TFetchOrientation string") + switch s { + case "FETCH_NEXT": return TFetchOrientation_FETCH_NEXT, nil + case "FETCH_PRIOR": return TFetchOrientation_FETCH_PRIOR, nil + case "FETCH_RELATIVE": return TFetchOrientation_FETCH_RELATIVE, nil + case "FETCH_ABSOLUTE": return TFetchOrientation_FETCH_ABSOLUTE, nil + case "FETCH_FIRST": return TFetchOrientation_FETCH_FIRST, nil + case "FETCH_LAST": return TFetchOrientation_FETCH_LAST, nil + } + return TFetchOrientation(0), fmt.Errorf("not a valid TFetchOrientation string") } + func TFetchOrientationPtr(v TFetchOrientation) *TFetchOrientation { return &v } func (p TFetchOrientation) MarshalText() ([]byte, error) { - return []byte(p.String()), nil +return []byte(p.String()), nil } func (p *TFetchOrientation) UnmarshalText(text []byte) error { - q, err := TFetchOrientationFromString(string(text)) - if err != nil { - return err - } - *p = q - return nil +q, err := TFetchOrientationFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil } func (p *TFetchOrientation) Scan(value interface{}) error { - v, ok := value.(int64) - if !ok { - return errors.New("Scan value is not int64") - } - *p = TFetchOrientation(v) - return nil +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") } - -func (p *TFetchOrientation) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil +*p = TFetchOrientation(v) +return nil } +func (p * TFetchOrientation) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} type TJobExecutionStatus int64 - const ( - TJobExecutionStatus_IN_PROGRESS TJobExecutionStatus = 0 - TJobExecutionStatus_COMPLETE TJobExecutionStatus = 1 - TJobExecutionStatus_NOT_AVAILABLE TJobExecutionStatus = 2 + TJobExecutionStatus_IN_PROGRESS TJobExecutionStatus = 0 + TJobExecutionStatus_COMPLETE TJobExecutionStatus = 1 + TJobExecutionStatus_NOT_AVAILABLE TJobExecutionStatus = 2 ) func (p TJobExecutionStatus) String() string { - switch p { - case TJobExecutionStatus_IN_PROGRESS: - return "IN_PROGRESS" - case TJobExecutionStatus_COMPLETE: - return "COMPLETE" - case TJobExecutionStatus_NOT_AVAILABLE: - return "NOT_AVAILABLE" - } - return "" + switch p { + case TJobExecutionStatus_IN_PROGRESS: return "IN_PROGRESS" + case TJobExecutionStatus_COMPLETE: return "COMPLETE" + case TJobExecutionStatus_NOT_AVAILABLE: return "NOT_AVAILABLE" + } + return "" } func TJobExecutionStatusFromString(s string) (TJobExecutionStatus, error) { - switch s { - case "IN_PROGRESS": - return TJobExecutionStatus_IN_PROGRESS, nil - case "COMPLETE": - return TJobExecutionStatus_COMPLETE, nil - case "NOT_AVAILABLE": - return TJobExecutionStatus_NOT_AVAILABLE, nil - } - return TJobExecutionStatus(0), fmt.Errorf("not a valid TJobExecutionStatus string") + switch s { + case "IN_PROGRESS": return TJobExecutionStatus_IN_PROGRESS, nil + case "COMPLETE": return TJobExecutionStatus_COMPLETE, nil + case "NOT_AVAILABLE": return TJobExecutionStatus_NOT_AVAILABLE, nil + } + return TJobExecutionStatus(0), fmt.Errorf("not a valid TJobExecutionStatus string") } + func TJobExecutionStatusPtr(v TJobExecutionStatus) *TJobExecutionStatus { return &v } func (p TJobExecutionStatus) MarshalText() ([]byte, error) { - return []byte(p.String()), nil +return []byte(p.String()), nil } func (p *TJobExecutionStatus) UnmarshalText(text []byte) error { - q, err := TJobExecutionStatusFromString(string(text)) - if err != nil { - return err - } - *p = q - return nil +q, err := TJobExecutionStatusFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil } func (p *TJobExecutionStatus) Scan(value interface{}) error { - v, ok := value.(int64) - if !ok { - return errors.New("Scan value is not int64") - } - *p = TJobExecutionStatus(v) - return nil +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") } - -func (p *TJobExecutionStatus) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil +*p = TJobExecutionStatus(v) +return nil } +func (p * TJobExecutionStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} type TTypeEntryPtr int32 func TTypeEntryPtrPtr(v TTypeEntryPtr) *TTypeEntryPtr { return &v } @@ -1298,31845 +1015,28476 @@ type TSparkParameterList []*TSparkParameter func TSparkParameterListPtr(v TSparkParameterList) *TSparkParameterList { return &v } // Attributes: -// - I32Value -// - StringValue +// - I32Value +// - StringValue type TTypeQualifierValue struct { - I32Value *int32 `thrift:"i32Value,1" db:"i32Value" json:"i32Value,omitempty"` - StringValue *string `thrift:"stringValue,2" db:"stringValue" json:"stringValue,omitempty"` + I32Value *int32 `thrift:"i32Value,1" db:"i32Value" json:"i32Value,omitempty"` + StringValue *string `thrift:"stringValue,2" db:"stringValue" json:"stringValue,omitempty"` } func NewTTypeQualifierValue() *TTypeQualifierValue { - return &TTypeQualifierValue{} + return &TTypeQualifierValue{} } var TTypeQualifierValue_I32Value_DEFAULT int32 - func (p *TTypeQualifierValue) GetI32Value() int32 { - if !p.IsSetI32Value() { - return TTypeQualifierValue_I32Value_DEFAULT - } - return *p.I32Value + if !p.IsSetI32Value() { + return TTypeQualifierValue_I32Value_DEFAULT + } +return *p.I32Value } - var TTypeQualifierValue_StringValue_DEFAULT string - func (p *TTypeQualifierValue) GetStringValue() string { - if !p.IsSetStringValue() { - return TTypeQualifierValue_StringValue_DEFAULT - } - return *p.StringValue + if !p.IsSetStringValue() { + return TTypeQualifierValue_StringValue_DEFAULT + } +return *p.StringValue } func (p *TTypeQualifierValue) CountSetFieldsTTypeQualifierValue() int { - count := 0 - if p.IsSetI32Value() { - count++ - } - if p.IsSetStringValue() { - count++ - } - return count + count := 0 + if (p.IsSetI32Value()) { + count++ + } + if (p.IsSetStringValue()) { + count++ + } + return count } func (p *TTypeQualifierValue) IsSetI32Value() bool { - return p.I32Value != nil + return p.I32Value != nil } func (p *TTypeQualifierValue) IsSetStringValue() bool { - return p.StringValue != nil + return p.StringValue != nil } func (p *TTypeQualifierValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TTypeQualifierValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.I32Value = &v - } - return nil -} - -func (p *TTypeQualifierValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.StringValue = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TTypeQualifierValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.I32Value = &v +} + return nil +} + +func (p *TTypeQualifierValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.StringValue = &v +} + return nil } func (p *TTypeQualifierValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTTypeQualifierValue(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TTypeQualifierValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if c := p.CountSetFieldsTTypeQualifierValue(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TTypeQualifierValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TTypeQualifierValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI32Value() { - if err := oprot.WriteFieldBegin(ctx, "i32Value", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:i32Value: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.I32Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.i32Value (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:i32Value: ", p), err) - } - } - return err + if p.IsSetI32Value() { + if err := oprot.WriteFieldBegin(ctx, "i32Value", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:i32Value: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.I32Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.i32Value (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:i32Value: ", p), err) } + } + return err } func (p *TTypeQualifierValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringValue() { - if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stringValue: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.stringValue (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stringValue: ", p), err) - } - } - return err + if p.IsSetStringValue() { + if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stringValue: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stringValue (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stringValue: ", p), err) } + } + return err } func (p *TTypeQualifierValue) Equals(other *TTypeQualifierValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.I32Value != other.I32Value { - if p.I32Value == nil || other.I32Value == nil { - return false - } - if (*p.I32Value) != (*other.I32Value) { - return false - } - } - if p.StringValue != other.StringValue { - if p.StringValue == nil || other.StringValue == nil { - return false - } - if (*p.StringValue) != (*other.StringValue) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.I32Value != other.I32Value { + if p.I32Value == nil || other.I32Value == nil { + return false + } + if (*p.I32Value) != (*other.I32Value) { return false } + } + if p.StringValue != other.StringValue { + if p.StringValue == nil || other.StringValue == nil { + return false + } + if (*p.StringValue) != (*other.StringValue) { return false } + } + return true } func (p *TTypeQualifierValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTypeQualifierValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTypeQualifierValue(%+v)", *p) } func (p *TTypeQualifierValue) Validate() error { - return nil + return nil } - // Attributes: -// - Qualifiers +// - Qualifiers type TTypeQualifiers struct { - Qualifiers map[string]*TTypeQualifierValue `thrift:"qualifiers,1,required" db:"qualifiers" json:"qualifiers"` + Qualifiers map[string]*TTypeQualifierValue `thrift:"qualifiers,1,required" db:"qualifiers" json:"qualifiers"` } func NewTTypeQualifiers() *TTypeQualifiers { - return &TTypeQualifiers{} + return &TTypeQualifiers{} } + func (p *TTypeQualifiers) GetQualifiers() map[string]*TTypeQualifierValue { - return p.Qualifiers + return p.Qualifiers } func (p *TTypeQualifiers) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetQualifiers bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.MAP { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetQualifiers = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetQualifiers { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Qualifiers is not set")) - } - return nil -} - -func (p *TTypeQualifiers) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]*TTypeQualifierValue, size) - p.Qualifiers = tMap - for i := 0; i < size; i++ { - var _key0 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key0 = v - } - _val1 := &TTypeQualifierValue{} - if err := _val1.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val1), err) - } - p.Qualifiers[_key0] = _val1 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetQualifiers bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetQualifiers = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetQualifiers{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Qualifiers is not set")); + } + return nil +} + +func (p *TTypeQualifiers) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*TTypeQualifierValue, size) + p.Qualifiers = tMap + for i := 0; i < size; i ++ { +var _key0 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key0 = v +} + _val1 := &TTypeQualifierValue{} + if err := _val1.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val1), err) + } + p.Qualifiers[_key0] = _val1 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil } func (p *TTypeQualifiers) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TTypeQualifiers"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TTypeQualifiers"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TTypeQualifiers) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "qualifiers", thrift.MAP, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:qualifiers: ", p), err) - } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRUCT, len(p.Qualifiers)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.Qualifiers { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:qualifiers: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "qualifiers", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:qualifiers: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRUCT, len(p.Qualifiers)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Qualifiers { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:qualifiers: ", p), err) } + return err } func (p *TTypeQualifiers) Equals(other *TTypeQualifiers) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Qualifiers) != len(other.Qualifiers) { - return false - } - for k, _tgt := range p.Qualifiers { - _src2 := other.Qualifiers[k] - if !_tgt.Equals(_src2) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Qualifiers) != len(other.Qualifiers) { return false } + for k, _tgt := range p.Qualifiers { + _src2 := other.Qualifiers[k] + if !_tgt.Equals(_src2) { return false } + } + return true } func (p *TTypeQualifiers) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTypeQualifiers(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTypeQualifiers(%+v)", *p) } func (p *TTypeQualifiers) Validate() error { - return nil + return nil } - // Attributes: -// - Type -// - TypeQualifiers +// - Type +// - TypeQualifiers type TPrimitiveTypeEntry struct { - Type TTypeId `thrift:"type,1,required" db:"type" json:"type"` - TypeQualifiers *TTypeQualifiers `thrift:"typeQualifiers,2" db:"typeQualifiers" json:"typeQualifiers,omitempty"` + Type TTypeId `thrift:"type,1,required" db:"type" json:"type"` + TypeQualifiers *TTypeQualifiers `thrift:"typeQualifiers,2" db:"typeQualifiers" json:"typeQualifiers,omitempty"` } func NewTPrimitiveTypeEntry() *TPrimitiveTypeEntry { - return &TPrimitiveTypeEntry{} + return &TPrimitiveTypeEntry{} } + func (p *TPrimitiveTypeEntry) GetType() TTypeId { - return p.Type + return p.Type } - var TPrimitiveTypeEntry_TypeQualifiers_DEFAULT *TTypeQualifiers - func (p *TPrimitiveTypeEntry) GetTypeQualifiers() *TTypeQualifiers { - if !p.IsSetTypeQualifiers() { - return TPrimitiveTypeEntry_TypeQualifiers_DEFAULT - } - return p.TypeQualifiers + if !p.IsSetTypeQualifiers() { + return TPrimitiveTypeEntry_TypeQualifiers_DEFAULT + } +return p.TypeQualifiers } func (p *TPrimitiveTypeEntry) IsSetTypeQualifiers() bool { - return p.TypeQualifiers != nil + return p.TypeQualifiers != nil } func (p *TPrimitiveTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetType bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetType = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetType { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")) - } - return nil -} - -func (p *TPrimitiveTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := TTypeId(v) - p.Type = temp - } - return nil -} - -func (p *TPrimitiveTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.TypeQualifiers = &TTypeQualifiers{} - if err := p.TypeQualifiers.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeQualifiers), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetType bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetType = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetType{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")); + } + return nil +} + +func (p *TPrimitiveTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := TTypeId(v) + p.Type = temp +} + return nil +} + +func (p *TPrimitiveTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.TypeQualifiers = &TTypeQualifiers{} + if err := p.TypeQualifiers.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeQualifiers), err) + } + return nil } func (p *TPrimitiveTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TPrimitiveTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TPrimitiveTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TPrimitiveTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err } func (p *TPrimitiveTypeEntry) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTypeQualifiers() { - if err := oprot.WriteFieldBegin(ctx, "typeQualifiers", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:typeQualifiers: ", p), err) - } - if err := p.TypeQualifiers.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeQualifiers), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeQualifiers: ", p), err) - } - } - return err + if p.IsSetTypeQualifiers() { + if err := oprot.WriteFieldBegin(ctx, "typeQualifiers", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:typeQualifiers: ", p), err) } + if err := p.TypeQualifiers.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeQualifiers), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeQualifiers: ", p), err) } + } + return err } func (p *TPrimitiveTypeEntry) Equals(other *TPrimitiveTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Type != other.Type { - return false - } - if !p.TypeQualifiers.Equals(other.TypeQualifiers) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Type != other.Type { return false } + if !p.TypeQualifiers.Equals(other.TypeQualifiers) { return false } + return true } func (p *TPrimitiveTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TPrimitiveTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TPrimitiveTypeEntry(%+v)", *p) } func (p *TPrimitiveTypeEntry) Validate() error { - return nil + return nil } - // Attributes: -// - ObjectTypePtr +// - ObjectTypePtr type TArrayTypeEntry struct { - ObjectTypePtr TTypeEntryPtr `thrift:"objectTypePtr,1,required" db:"objectTypePtr" json:"objectTypePtr"` + ObjectTypePtr TTypeEntryPtr `thrift:"objectTypePtr,1,required" db:"objectTypePtr" json:"objectTypePtr"` } func NewTArrayTypeEntry() *TArrayTypeEntry { - return &TArrayTypeEntry{} + return &TArrayTypeEntry{} } + func (p *TArrayTypeEntry) GetObjectTypePtr() TTypeEntryPtr { - return p.ObjectTypePtr + return p.ObjectTypePtr } func (p *TArrayTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetObjectTypePtr bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetObjectTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetObjectTypePtr { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ObjectTypePtr is not set")) - } - return nil -} - -func (p *TArrayTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := TTypeEntryPtr(v) - p.ObjectTypePtr = temp - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetObjectTypePtr bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetObjectTypePtr = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetObjectTypePtr{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ObjectTypePtr is not set")); + } + return nil +} + +func (p *TArrayTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := TTypeEntryPtr(v) + p.ObjectTypePtr = temp +} + return nil } func (p *TArrayTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TArrayTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TArrayTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TArrayTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "objectTypePtr", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:objectTypePtr: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(p.ObjectTypePtr)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.objectTypePtr (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:objectTypePtr: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "objectTypePtr", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:objectTypePtr: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.ObjectTypePtr)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.objectTypePtr (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:objectTypePtr: ", p), err) } + return err } func (p *TArrayTypeEntry) Equals(other *TArrayTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.ObjectTypePtr != other.ObjectTypePtr { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ObjectTypePtr != other.ObjectTypePtr { return false } + return true } func (p *TArrayTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TArrayTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TArrayTypeEntry(%+v)", *p) } func (p *TArrayTypeEntry) Validate() error { - return nil + return nil } - // Attributes: -// - KeyTypePtr -// - ValueTypePtr +// - KeyTypePtr +// - ValueTypePtr type TMapTypeEntry struct { - KeyTypePtr TTypeEntryPtr `thrift:"keyTypePtr,1,required" db:"keyTypePtr" json:"keyTypePtr"` - ValueTypePtr TTypeEntryPtr `thrift:"valueTypePtr,2,required" db:"valueTypePtr" json:"valueTypePtr"` + KeyTypePtr TTypeEntryPtr `thrift:"keyTypePtr,1,required" db:"keyTypePtr" json:"keyTypePtr"` + ValueTypePtr TTypeEntryPtr `thrift:"valueTypePtr,2,required" db:"valueTypePtr" json:"valueTypePtr"` } func NewTMapTypeEntry() *TMapTypeEntry { - return &TMapTypeEntry{} + return &TMapTypeEntry{} } + func (p *TMapTypeEntry) GetKeyTypePtr() TTypeEntryPtr { - return p.KeyTypePtr + return p.KeyTypePtr } func (p *TMapTypeEntry) GetValueTypePtr() TTypeEntryPtr { - return p.ValueTypePtr + return p.ValueTypePtr } func (p *TMapTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetKeyTypePtr bool = false - var issetValueTypePtr bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetKeyTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetValueTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetKeyTypePtr { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field KeyTypePtr is not set")) - } - if !issetValueTypePtr { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ValueTypePtr is not set")) - } - return nil -} - -func (p *TMapTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := TTypeEntryPtr(v) - p.KeyTypePtr = temp - } - return nil -} - -func (p *TMapTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TTypeEntryPtr(v) - p.ValueTypePtr = temp - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetKeyTypePtr bool = false; + var issetValueTypePtr bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetKeyTypePtr = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetValueTypePtr = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetKeyTypePtr{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field KeyTypePtr is not set")); + } + if !issetValueTypePtr{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ValueTypePtr is not set")); + } + return nil +} + +func (p *TMapTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := TTypeEntryPtr(v) + p.KeyTypePtr = temp +} + return nil +} + +func (p *TMapTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TTypeEntryPtr(v) + p.ValueTypePtr = temp +} + return nil } func (p *TMapTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TMapTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TMapTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TMapTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "keyTypePtr", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:keyTypePtr: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(p.KeyTypePtr)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.keyTypePtr (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:keyTypePtr: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "keyTypePtr", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:keyTypePtr: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.KeyTypePtr)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.keyTypePtr (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:keyTypePtr: ", p), err) } + return err } func (p *TMapTypeEntry) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "valueTypePtr", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:valueTypePtr: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(p.ValueTypePtr)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.valueTypePtr (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:valueTypePtr: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "valueTypePtr", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:valueTypePtr: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.ValueTypePtr)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.valueTypePtr (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:valueTypePtr: ", p), err) } + return err } func (p *TMapTypeEntry) Equals(other *TMapTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.KeyTypePtr != other.KeyTypePtr { - return false - } - if p.ValueTypePtr != other.ValueTypePtr { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.KeyTypePtr != other.KeyTypePtr { return false } + if p.ValueTypePtr != other.ValueTypePtr { return false } + return true } func (p *TMapTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TMapTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TMapTypeEntry(%+v)", *p) } func (p *TMapTypeEntry) Validate() error { - return nil + return nil } - // Attributes: -// - NameToTypePtr +// - NameToTypePtr type TStructTypeEntry struct { - NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"` + NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"` } func NewTStructTypeEntry() *TStructTypeEntry { - return &TStructTypeEntry{} + return &TStructTypeEntry{} } + func (p *TStructTypeEntry) GetNameToTypePtr() map[string]TTypeEntryPtr { - return p.NameToTypePtr + return p.NameToTypePtr } func (p *TStructTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetNameToTypePtr bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.MAP { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetNameToTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetNameToTypePtr { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NameToTypePtr is not set")) - } - return nil -} - -func (p *TStructTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]TTypeEntryPtr, size) - p.NameToTypePtr = tMap - for i := 0; i < size; i++ { - var _key3 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key3 = v - } - var _val4 TTypeEntryPtr - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := TTypeEntryPtr(v) - _val4 = temp - } - p.NameToTypePtr[_key3] = _val4 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetNameToTypePtr bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetNameToTypePtr = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetNameToTypePtr{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NameToTypePtr is not set")); + } + return nil +} + +func (p *TStructTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]TTypeEntryPtr, size) + p.NameToTypePtr = tMap + for i := 0; i < size; i ++ { +var _key3 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key3 = v +} +var _val4 TTypeEntryPtr + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := TTypeEntryPtr(v) + _val4 = temp +} + p.NameToTypePtr[_key3] = _val4 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil } func (p *TStructTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStructTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TStructTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TStructTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nameToTypePtr", thrift.MAP, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) - } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.NameToTypePtr { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "nameToTypePtr", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.NameToTypePtr { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) } + return err } func (p *TStructTypeEntry) Equals(other *TStructTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.NameToTypePtr) != len(other.NameToTypePtr) { - return false - } - for k, _tgt := range p.NameToTypePtr { - _src5 := other.NameToTypePtr[k] - if _tgt != _src5 { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.NameToTypePtr) != len(other.NameToTypePtr) { return false } + for k, _tgt := range p.NameToTypePtr { + _src5 := other.NameToTypePtr[k] + if _tgt != _src5 { return false } + } + return true } func (p *TStructTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TStructTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TStructTypeEntry(%+v)", *p) } func (p *TStructTypeEntry) Validate() error { - return nil + return nil } - // Attributes: -// - NameToTypePtr +// - NameToTypePtr type TUnionTypeEntry struct { - NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"` + NameToTypePtr map[string]TTypeEntryPtr `thrift:"nameToTypePtr,1,required" db:"nameToTypePtr" json:"nameToTypePtr"` } func NewTUnionTypeEntry() *TUnionTypeEntry { - return &TUnionTypeEntry{} + return &TUnionTypeEntry{} } + func (p *TUnionTypeEntry) GetNameToTypePtr() map[string]TTypeEntryPtr { - return p.NameToTypePtr + return p.NameToTypePtr } func (p *TUnionTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetNameToTypePtr bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.MAP { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetNameToTypePtr = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetNameToTypePtr { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NameToTypePtr is not set")) - } - return nil -} - -func (p *TUnionTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]TTypeEntryPtr, size) - p.NameToTypePtr = tMap - for i := 0; i < size; i++ { - var _key6 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key6 = v - } - var _val7 TTypeEntryPtr - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := TTypeEntryPtr(v) - _val7 = temp - } - p.NameToTypePtr[_key6] = _val7 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetNameToTypePtr bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetNameToTypePtr = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetNameToTypePtr{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NameToTypePtr is not set")); + } + return nil +} + +func (p *TUnionTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]TTypeEntryPtr, size) + p.NameToTypePtr = tMap + for i := 0; i < size; i ++ { +var _key6 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key6 = v +} +var _val7 TTypeEntryPtr + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := TTypeEntryPtr(v) + _val7 = temp +} + p.NameToTypePtr[_key6] = _val7 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil } func (p *TUnionTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TUnionTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TUnionTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TUnionTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nameToTypePtr", thrift.MAP, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) - } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.NameToTypePtr { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "nameToTypePtr", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.NameToTypePtr { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) } + return err } func (p *TUnionTypeEntry) Equals(other *TUnionTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.NameToTypePtr) != len(other.NameToTypePtr) { - return false - } - for k, _tgt := range p.NameToTypePtr { - _src8 := other.NameToTypePtr[k] - if _tgt != _src8 { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.NameToTypePtr) != len(other.NameToTypePtr) { return false } + for k, _tgt := range p.NameToTypePtr { + _src8 := other.NameToTypePtr[k] + if _tgt != _src8 { return false } + } + return true } func (p *TUnionTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TUnionTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TUnionTypeEntry(%+v)", *p) } func (p *TUnionTypeEntry) Validate() error { - return nil + return nil } - // Attributes: -// - TypeClassName +// - TypeClassName type TUserDefinedTypeEntry struct { - TypeClassName string `thrift:"typeClassName,1,required" db:"typeClassName" json:"typeClassName"` + TypeClassName string `thrift:"typeClassName,1,required" db:"typeClassName" json:"typeClassName"` } func NewTUserDefinedTypeEntry() *TUserDefinedTypeEntry { - return &TUserDefinedTypeEntry{} + return &TUserDefinedTypeEntry{} } + func (p *TUserDefinedTypeEntry) GetTypeClassName() string { - return p.TypeClassName + return p.TypeClassName } func (p *TUserDefinedTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetTypeClassName bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetTypeClassName = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetTypeClassName { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TypeClassName is not set")) - } - return nil -} - -func (p *TUserDefinedTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.TypeClassName = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetTypeClassName bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetTypeClassName = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetTypeClassName{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TypeClassName is not set")); + } + return nil +} + +func (p *TUserDefinedTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.TypeClassName = v +} + return nil } func (p *TUserDefinedTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TUserDefinedTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TUserDefinedTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TUserDefinedTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "typeClassName", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:typeClassName: ", p), err) - } - if err := oprot.WriteString(ctx, string(p.TypeClassName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.typeClassName (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:typeClassName: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "typeClassName", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:typeClassName: ", p), err) } + if err := oprot.WriteString(ctx, string(p.TypeClassName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.typeClassName (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:typeClassName: ", p), err) } + return err } func (p *TUserDefinedTypeEntry) Equals(other *TUserDefinedTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.TypeClassName != other.TypeClassName { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.TypeClassName != other.TypeClassName { return false } + return true } func (p *TUserDefinedTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TUserDefinedTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TUserDefinedTypeEntry(%+v)", *p) } func (p *TUserDefinedTypeEntry) Validate() error { - return nil + return nil } - // Attributes: -// - PrimitiveEntry -// - ArrayEntry -// - MapEntry -// - StructEntry -// - UnionEntry -// - UserDefinedTypeEntry +// - PrimitiveEntry +// - ArrayEntry +// - MapEntry +// - StructEntry +// - UnionEntry +// - UserDefinedTypeEntry type TTypeEntry struct { - PrimitiveEntry *TPrimitiveTypeEntry `thrift:"primitiveEntry,1" db:"primitiveEntry" json:"primitiveEntry,omitempty"` - ArrayEntry *TArrayTypeEntry `thrift:"arrayEntry,2" db:"arrayEntry" json:"arrayEntry,omitempty"` - MapEntry *TMapTypeEntry `thrift:"mapEntry,3" db:"mapEntry" json:"mapEntry,omitempty"` - StructEntry *TStructTypeEntry `thrift:"structEntry,4" db:"structEntry" json:"structEntry,omitempty"` - UnionEntry *TUnionTypeEntry `thrift:"unionEntry,5" db:"unionEntry" json:"unionEntry,omitempty"` - UserDefinedTypeEntry *TUserDefinedTypeEntry `thrift:"userDefinedTypeEntry,6" db:"userDefinedTypeEntry" json:"userDefinedTypeEntry,omitempty"` + PrimitiveEntry *TPrimitiveTypeEntry `thrift:"primitiveEntry,1" db:"primitiveEntry" json:"primitiveEntry,omitempty"` + ArrayEntry *TArrayTypeEntry `thrift:"arrayEntry,2" db:"arrayEntry" json:"arrayEntry,omitempty"` + MapEntry *TMapTypeEntry `thrift:"mapEntry,3" db:"mapEntry" json:"mapEntry,omitempty"` + StructEntry *TStructTypeEntry `thrift:"structEntry,4" db:"structEntry" json:"structEntry,omitempty"` + UnionEntry *TUnionTypeEntry `thrift:"unionEntry,5" db:"unionEntry" json:"unionEntry,omitempty"` + UserDefinedTypeEntry *TUserDefinedTypeEntry `thrift:"userDefinedTypeEntry,6" db:"userDefinedTypeEntry" json:"userDefinedTypeEntry,omitempty"` } func NewTTypeEntry() *TTypeEntry { - return &TTypeEntry{} + return &TTypeEntry{} } var TTypeEntry_PrimitiveEntry_DEFAULT *TPrimitiveTypeEntry - func (p *TTypeEntry) GetPrimitiveEntry() *TPrimitiveTypeEntry { - if !p.IsSetPrimitiveEntry() { - return TTypeEntry_PrimitiveEntry_DEFAULT - } - return p.PrimitiveEntry + if !p.IsSetPrimitiveEntry() { + return TTypeEntry_PrimitiveEntry_DEFAULT + } +return p.PrimitiveEntry } - var TTypeEntry_ArrayEntry_DEFAULT *TArrayTypeEntry - func (p *TTypeEntry) GetArrayEntry() *TArrayTypeEntry { - if !p.IsSetArrayEntry() { - return TTypeEntry_ArrayEntry_DEFAULT - } - return p.ArrayEntry + if !p.IsSetArrayEntry() { + return TTypeEntry_ArrayEntry_DEFAULT + } +return p.ArrayEntry } - var TTypeEntry_MapEntry_DEFAULT *TMapTypeEntry - func (p *TTypeEntry) GetMapEntry() *TMapTypeEntry { - if !p.IsSetMapEntry() { - return TTypeEntry_MapEntry_DEFAULT - } - return p.MapEntry + if !p.IsSetMapEntry() { + return TTypeEntry_MapEntry_DEFAULT + } +return p.MapEntry } - var TTypeEntry_StructEntry_DEFAULT *TStructTypeEntry - func (p *TTypeEntry) GetStructEntry() *TStructTypeEntry { - if !p.IsSetStructEntry() { - return TTypeEntry_StructEntry_DEFAULT - } - return p.StructEntry + if !p.IsSetStructEntry() { + return TTypeEntry_StructEntry_DEFAULT + } +return p.StructEntry } - var TTypeEntry_UnionEntry_DEFAULT *TUnionTypeEntry - func (p *TTypeEntry) GetUnionEntry() *TUnionTypeEntry { - if !p.IsSetUnionEntry() { - return TTypeEntry_UnionEntry_DEFAULT - } - return p.UnionEntry + if !p.IsSetUnionEntry() { + return TTypeEntry_UnionEntry_DEFAULT + } +return p.UnionEntry } - var TTypeEntry_UserDefinedTypeEntry_DEFAULT *TUserDefinedTypeEntry - func (p *TTypeEntry) GetUserDefinedTypeEntry() *TUserDefinedTypeEntry { - if !p.IsSetUserDefinedTypeEntry() { - return TTypeEntry_UserDefinedTypeEntry_DEFAULT - } - return p.UserDefinedTypeEntry + if !p.IsSetUserDefinedTypeEntry() { + return TTypeEntry_UserDefinedTypeEntry_DEFAULT + } +return p.UserDefinedTypeEntry } func (p *TTypeEntry) CountSetFieldsTTypeEntry() int { - count := 0 - if p.IsSetPrimitiveEntry() { - count++ - } - if p.IsSetArrayEntry() { - count++ - } - if p.IsSetMapEntry() { - count++ - } - if p.IsSetStructEntry() { - count++ - } - if p.IsSetUnionEntry() { - count++ - } - if p.IsSetUserDefinedTypeEntry() { - count++ - } - return count + count := 0 + if (p.IsSetPrimitiveEntry()) { + count++ + } + if (p.IsSetArrayEntry()) { + count++ + } + if (p.IsSetMapEntry()) { + count++ + } + if (p.IsSetStructEntry()) { + count++ + } + if (p.IsSetUnionEntry()) { + count++ + } + if (p.IsSetUserDefinedTypeEntry()) { + count++ + } + return count } func (p *TTypeEntry) IsSetPrimitiveEntry() bool { - return p.PrimitiveEntry != nil + return p.PrimitiveEntry != nil } func (p *TTypeEntry) IsSetArrayEntry() bool { - return p.ArrayEntry != nil + return p.ArrayEntry != nil } func (p *TTypeEntry) IsSetMapEntry() bool { - return p.MapEntry != nil + return p.MapEntry != nil } func (p *TTypeEntry) IsSetStructEntry() bool { - return p.StructEntry != nil + return p.StructEntry != nil } func (p *TTypeEntry) IsSetUnionEntry() bool { - return p.UnionEntry != nil + return p.UnionEntry != nil } func (p *TTypeEntry) IsSetUserDefinedTypeEntry() bool { - return p.UserDefinedTypeEntry != nil + return p.UserDefinedTypeEntry != nil } func (p *TTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.PrimitiveEntry = &TPrimitiveTypeEntry{} - if err := p.PrimitiveEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PrimitiveEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ArrayEntry = &TArrayTypeEntry{} - if err := p.ArrayEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ArrayEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.MapEntry = &TMapTypeEntry{} - if err := p.MapEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MapEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.StructEntry = &TStructTypeEntry{} - if err := p.StructEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StructEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - p.UnionEntry = &TUnionTypeEntry{} - if err := p.UnionEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UnionEntry), err) - } - return nil -} - -func (p *TTypeEntry) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - p.UserDefinedTypeEntry = &TUserDefinedTypeEntry{} - if err := p.UserDefinedTypeEntry.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UserDefinedTypeEntry), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.PrimitiveEntry = &TPrimitiveTypeEntry{} + if err := p.PrimitiveEntry.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PrimitiveEntry), err) + } + return nil +} + +func (p *TTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.ArrayEntry = &TArrayTypeEntry{} + if err := p.ArrayEntry.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ArrayEntry), err) + } + return nil +} + +func (p *TTypeEntry) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.MapEntry = &TMapTypeEntry{} + if err := p.MapEntry.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MapEntry), err) + } + return nil +} + +func (p *TTypeEntry) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.StructEntry = &TStructTypeEntry{} + if err := p.StructEntry.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StructEntry), err) + } + return nil +} + +func (p *TTypeEntry) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + p.UnionEntry = &TUnionTypeEntry{} + if err := p.UnionEntry.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UnionEntry), err) + } + return nil +} + +func (p *TTypeEntry) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + p.UserDefinedTypeEntry = &TUserDefinedTypeEntry{} + if err := p.UserDefinedTypeEntry.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UserDefinedTypeEntry), err) + } + return nil } func (p *TTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTTypeEntry(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TTypeEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - if err := p.writeField6(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if c := p.CountSetFieldsTTypeEntry(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TTypeEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetPrimitiveEntry() { - if err := oprot.WriteFieldBegin(ctx, "primitiveEntry", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:primitiveEntry: ", p), err) - } - if err := p.PrimitiveEntry.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PrimitiveEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:primitiveEntry: ", p), err) - } - } - return err + if p.IsSetPrimitiveEntry() { + if err := oprot.WriteFieldBegin(ctx, "primitiveEntry", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:primitiveEntry: ", p), err) } + if err := p.PrimitiveEntry.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PrimitiveEntry), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:primitiveEntry: ", p), err) } + } + return err } func (p *TTypeEntry) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArrayEntry() { - if err := oprot.WriteFieldBegin(ctx, "arrayEntry", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:arrayEntry: ", p), err) - } - if err := p.ArrayEntry.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ArrayEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:arrayEntry: ", p), err) - } - } - return err + if p.IsSetArrayEntry() { + if err := oprot.WriteFieldBegin(ctx, "arrayEntry", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:arrayEntry: ", p), err) } + if err := p.ArrayEntry.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ArrayEntry), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:arrayEntry: ", p), err) } + } + return err } func (p *TTypeEntry) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetMapEntry() { - if err := oprot.WriteFieldBegin(ctx, "mapEntry", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:mapEntry: ", p), err) - } - if err := p.MapEntry.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MapEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mapEntry: ", p), err) - } - } - return err + if p.IsSetMapEntry() { + if err := oprot.WriteFieldBegin(ctx, "mapEntry", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:mapEntry: ", p), err) } + if err := p.MapEntry.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MapEntry), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mapEntry: ", p), err) } + } + return err } func (p *TTypeEntry) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStructEntry() { - if err := oprot.WriteFieldBegin(ctx, "structEntry", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:structEntry: ", p), err) - } - if err := p.StructEntry.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StructEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:structEntry: ", p), err) - } - } - return err + if p.IsSetStructEntry() { + if err := oprot.WriteFieldBegin(ctx, "structEntry", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:structEntry: ", p), err) } + if err := p.StructEntry.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StructEntry), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:structEntry: ", p), err) } + } + return err } func (p *TTypeEntry) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetUnionEntry() { - if err := oprot.WriteFieldBegin(ctx, "unionEntry", thrift.STRUCT, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:unionEntry: ", p), err) - } - if err := p.UnionEntry.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UnionEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:unionEntry: ", p), err) - } - } - return err + if p.IsSetUnionEntry() { + if err := oprot.WriteFieldBegin(ctx, "unionEntry", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:unionEntry: ", p), err) } + if err := p.UnionEntry.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UnionEntry), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:unionEntry: ", p), err) } + } + return err } func (p *TTypeEntry) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetUserDefinedTypeEntry() { - if err := oprot.WriteFieldBegin(ctx, "userDefinedTypeEntry", thrift.STRUCT, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:userDefinedTypeEntry: ", p), err) - } - if err := p.UserDefinedTypeEntry.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UserDefinedTypeEntry), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:userDefinedTypeEntry: ", p), err) - } - } - return err + if p.IsSetUserDefinedTypeEntry() { + if err := oprot.WriteFieldBegin(ctx, "userDefinedTypeEntry", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:userDefinedTypeEntry: ", p), err) } + if err := p.UserDefinedTypeEntry.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UserDefinedTypeEntry), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:userDefinedTypeEntry: ", p), err) } + } + return err } func (p *TTypeEntry) Equals(other *TTypeEntry) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.PrimitiveEntry.Equals(other.PrimitiveEntry) { - return false - } - if !p.ArrayEntry.Equals(other.ArrayEntry) { - return false - } - if !p.MapEntry.Equals(other.MapEntry) { - return false - } - if !p.StructEntry.Equals(other.StructEntry) { - return false - } - if !p.UnionEntry.Equals(other.UnionEntry) { - return false - } - if !p.UserDefinedTypeEntry.Equals(other.UserDefinedTypeEntry) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.PrimitiveEntry.Equals(other.PrimitiveEntry) { return false } + if !p.ArrayEntry.Equals(other.ArrayEntry) { return false } + if !p.MapEntry.Equals(other.MapEntry) { return false } + if !p.StructEntry.Equals(other.StructEntry) { return false } + if !p.UnionEntry.Equals(other.UnionEntry) { return false } + if !p.UserDefinedTypeEntry.Equals(other.UserDefinedTypeEntry) { return false } + return true } func (p *TTypeEntry) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTypeEntry(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTypeEntry(%+v)", *p) } func (p *TTypeEntry) Validate() error { - return nil + return nil } - // Attributes: -// - Types +// - Types type TTypeDesc struct { - Types []*TTypeEntry `thrift:"types,1,required" db:"types" json:"types"` + Types []*TTypeEntry `thrift:"types,1,required" db:"types" json:"types"` } func NewTTypeDesc() *TTypeDesc { - return &TTypeDesc{} + return &TTypeDesc{} } + func (p *TTypeDesc) GetTypes() []*TTypeEntry { - return p.Types + return p.Types } func (p *TTypeDesc) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetTypes bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetTypes = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetTypes { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Types is not set")) - } - return nil -} - -func (p *TTypeDesc) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TTypeEntry, 0, size) - p.Types = tSlice - for i := 0; i < size; i++ { - _elem9 := &TTypeEntry{} - if err := _elem9.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) - } - p.Types = append(p.Types, _elem9) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetTypes bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetTypes = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetTypes{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Types is not set")); + } + return nil +} + +func (p *TTypeDesc) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TTypeEntry, 0, size) + p.Types = tSlice + for i := 0; i < size; i ++ { + _elem9 := &TTypeEntry{} + if err := _elem9.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + p.Types = append(p.Types, _elem9) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TTypeDesc) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TTypeDesc"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TTypeDesc"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TTypeDesc) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "types", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:types: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Types)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Types { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:types: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "types", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:types: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Types)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Types { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:types: ", p), err) } + return err } func (p *TTypeDesc) Equals(other *TTypeDesc) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Types) != len(other.Types) { - return false - } - for i, _tgt := range p.Types { - _src10 := other.Types[i] - if !_tgt.Equals(_src10) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Types) != len(other.Types) { return false } + for i, _tgt := range p.Types { + _src10 := other.Types[i] + if !_tgt.Equals(_src10) { return false } + } + return true } func (p *TTypeDesc) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTypeDesc(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTypeDesc(%+v)", *p) } func (p *TTypeDesc) Validate() error { - return nil + return nil } - // Attributes: -// - ColumnName -// - TypeDesc -// - Position -// - Comment +// - ColumnName +// - TypeDesc +// - Position +// - Comment type TColumnDesc struct { - ColumnName string `thrift:"columnName,1,required" db:"columnName" json:"columnName"` - TypeDesc *TTypeDesc `thrift:"typeDesc,2,required" db:"typeDesc" json:"typeDesc"` - Position int32 `thrift:"position,3,required" db:"position" json:"position"` - Comment *string `thrift:"comment,4" db:"comment" json:"comment,omitempty"` + ColumnName string `thrift:"columnName,1,required" db:"columnName" json:"columnName"` + TypeDesc *TTypeDesc `thrift:"typeDesc,2,required" db:"typeDesc" json:"typeDesc"` + Position int32 `thrift:"position,3,required" db:"position" json:"position"` + Comment *string `thrift:"comment,4" db:"comment" json:"comment,omitempty"` } func NewTColumnDesc() *TColumnDesc { - return &TColumnDesc{} + return &TColumnDesc{} } + func (p *TColumnDesc) GetColumnName() string { - return p.ColumnName + return p.ColumnName } - var TColumnDesc_TypeDesc_DEFAULT *TTypeDesc - func (p *TColumnDesc) GetTypeDesc() *TTypeDesc { - if !p.IsSetTypeDesc() { - return TColumnDesc_TypeDesc_DEFAULT - } - return p.TypeDesc + if !p.IsSetTypeDesc() { + return TColumnDesc_TypeDesc_DEFAULT + } +return p.TypeDesc } func (p *TColumnDesc) GetPosition() int32 { - return p.Position + return p.Position } - var TColumnDesc_Comment_DEFAULT string - func (p *TColumnDesc) GetComment() string { - if !p.IsSetComment() { - return TColumnDesc_Comment_DEFAULT - } - return *p.Comment + if !p.IsSetComment() { + return TColumnDesc_Comment_DEFAULT + } +return *p.Comment } func (p *TColumnDesc) IsSetTypeDesc() bool { - return p.TypeDesc != nil + return p.TypeDesc != nil } func (p *TColumnDesc) IsSetComment() bool { - return p.Comment != nil + return p.Comment != nil } func (p *TColumnDesc) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetColumnName bool = false - var issetTypeDesc bool = false - var issetPosition bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetColumnName = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetTypeDesc = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I32 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetPosition = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetColumnName { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ColumnName is not set")) - } - if !issetTypeDesc { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TypeDesc is not set")) - } - if !issetPosition { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Position is not set")) - } - return nil -} - -func (p *TColumnDesc) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.ColumnName = v - } - return nil -} - -func (p *TColumnDesc) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.TypeDesc = &TTypeDesc{} - if err := p.TypeDesc.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeDesc), err) - } - return nil -} - -func (p *TColumnDesc) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.Position = v - } - return nil -} - -func (p *TColumnDesc) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.Comment = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetColumnName bool = false; + var issetTypeDesc bool = false; + var issetPosition bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetColumnName = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetTypeDesc = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetPosition = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetColumnName{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ColumnName is not set")); + } + if !issetTypeDesc{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TypeDesc is not set")); + } + if !issetPosition{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Position is not set")); + } + return nil +} + +func (p *TColumnDesc) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ColumnName = v +} + return nil +} + +func (p *TColumnDesc) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.TypeDesc = &TTypeDesc{} + if err := p.TypeDesc.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeDesc), err) + } + return nil +} + +func (p *TColumnDesc) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Position = v +} + return nil +} + +func (p *TColumnDesc) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Comment = &v +} + return nil } func (p *TColumnDesc) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TColumnDesc"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TColumnDesc"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TColumnDesc) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "columnName", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columnName: ", p), err) - } - if err := oprot.WriteString(ctx, string(p.ColumnName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.columnName (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columnName: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "columnName", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columnName: ", p), err) } + if err := oprot.WriteString(ctx, string(p.ColumnName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.columnName (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columnName: ", p), err) } + return err } func (p *TColumnDesc) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "typeDesc", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:typeDesc: ", p), err) - } - if err := p.TypeDesc.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeDesc), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeDesc: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "typeDesc", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:typeDesc: ", p), err) } + if err := p.TypeDesc.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeDesc), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeDesc: ", p), err) } + return err } func (p *TColumnDesc) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "position", thrift.I32, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:position: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(p.Position)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.position (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:position: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "position", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:position: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Position)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.position (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:position: ", p), err) } + return err } func (p *TColumnDesc) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetComment() { - if err := oprot.WriteFieldBegin(ctx, "comment", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:comment: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.Comment)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.comment (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:comment: ", p), err) - } - } - return err + if p.IsSetComment() { + if err := oprot.WriteFieldBegin(ctx, "comment", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:comment: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.Comment)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:comment: ", p), err) } + } + return err } func (p *TColumnDesc) Equals(other *TColumnDesc) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.ColumnName != other.ColumnName { - return false - } - if !p.TypeDesc.Equals(other.TypeDesc) { - return false - } - if p.Position != other.Position { - return false - } - if p.Comment != other.Comment { - if p.Comment == nil || other.Comment == nil { - return false - } - if (*p.Comment) != (*other.Comment) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ColumnName != other.ColumnName { return false } + if !p.TypeDesc.Equals(other.TypeDesc) { return false } + if p.Position != other.Position { return false } + if p.Comment != other.Comment { + if p.Comment == nil || other.Comment == nil { + return false + } + if (*p.Comment) != (*other.Comment) { return false } + } + return true } func (p *TColumnDesc) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TColumnDesc(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TColumnDesc(%+v)", *p) } func (p *TColumnDesc) Validate() error { - return nil + return nil } - // Attributes: -// - Columns +// - Columns type TTableSchema struct { - Columns []*TColumnDesc `thrift:"columns,1,required" db:"columns" json:"columns"` + Columns []*TColumnDesc `thrift:"columns,1,required" db:"columns" json:"columns"` } func NewTTableSchema() *TTableSchema { - return &TTableSchema{} + return &TTableSchema{} } + func (p *TTableSchema) GetColumns() []*TColumnDesc { - return p.Columns + return p.Columns } func (p *TTableSchema) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetColumns bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetColumns = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetColumns { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Columns is not set")) - } - return nil -} - -func (p *TTableSchema) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TColumnDesc, 0, size) - p.Columns = tSlice - for i := 0; i < size; i++ { - _elem11 := &TColumnDesc{} - if err := _elem11.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) - } - p.Columns = append(p.Columns, _elem11) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetColumns bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetColumns = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetColumns{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Columns is not set")); + } + return nil +} + +func (p *TTableSchema) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TColumnDesc, 0, size) + p.Columns = tSlice + for i := 0; i < size; i ++ { + _elem11 := &TColumnDesc{} + if err := _elem11.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + } + p.Columns = append(p.Columns, _elem11) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TTableSchema) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TTableSchema"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TTableSchema"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TTableSchema) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columns: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Columns)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Columns { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columns: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columns: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Columns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Columns { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columns: ", p), err) } + return err } func (p *TTableSchema) Equals(other *TTableSchema) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Columns) != len(other.Columns) { - return false - } - for i, _tgt := range p.Columns { - _src12 := other.Columns[i] - if !_tgt.Equals(_src12) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Columns) != len(other.Columns) { return false } + for i, _tgt := range p.Columns { + _src12 := other.Columns[i] + if !_tgt.Equals(_src12) { return false } + } + return true } func (p *TTableSchema) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTableSchema(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TTableSchema(%+v)", *p) } func (p *TTableSchema) Validate() error { - return nil + return nil } - // Attributes: -// - Value +// - Value type TBoolValue struct { - Value *bool `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *bool `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTBoolValue() *TBoolValue { - return &TBoolValue{} + return &TBoolValue{} } var TBoolValue_Value_DEFAULT bool - func (p *TBoolValue) GetValue() bool { - if !p.IsSetValue() { - return TBoolValue_Value_DEFAULT - } - return *p.Value + if !p.IsSetValue() { + return TBoolValue_Value_DEFAULT + } +return *p.Value } func (p *TBoolValue) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TBoolValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TBoolValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Value = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TBoolValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Value = &v +} + return nil } func (p *TBoolValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TBoolValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TBoolValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TBoolValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.BOOL, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) - } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } + } + return err } func (p *TBoolValue) Equals(other *TBoolValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true } func (p *TBoolValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TBoolValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TBoolValue(%+v)", *p) } func (p *TBoolValue) Validate() error { - return nil + return nil } - // Attributes: -// - Value +// - Value type TByteValue struct { - Value *int8 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *int8 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTByteValue() *TByteValue { - return &TByteValue{} + return &TByteValue{} } var TByteValue_Value_DEFAULT int8 - func (p *TByteValue) GetValue() int8 { - if !p.IsSetValue() { - return TByteValue_Value_DEFAULT - } - return *p.Value + if !p.IsSetValue() { + return TByteValue_Value_DEFAULT + } +return *p.Value } func (p *TByteValue) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TByteValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.BYTE { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TByteValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadByte(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := int8(v) - p.Value = &temp - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.BYTE { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TByteValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := int8(v) + p.Value = &temp +} + return nil } func (p *TByteValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TByteValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TByteValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TByteValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.BYTE, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) - } - if err := oprot.WriteByte(ctx, int8(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) - } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.BYTE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } + if err := oprot.WriteByte(ctx, int8(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } + } + return err } func (p *TByteValue) Equals(other *TByteValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true } func (p *TByteValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TByteValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TByteValue(%+v)", *p) } func (p *TByteValue) Validate() error { - return nil + return nil } - // Attributes: -// - Value +// - Value type TI16Value struct { - Value *int16 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *int16 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTI16Value() *TI16Value { - return &TI16Value{} + return &TI16Value{} } var TI16Value_Value_DEFAULT int16 - func (p *TI16Value) GetValue() int16 { - if !p.IsSetValue() { - return TI16Value_Value_DEFAULT - } - return *p.Value + if !p.IsSetValue() { + return TI16Value_Value_DEFAULT + } +return *p.Value } func (p *TI16Value) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TI16Value) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I16 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TI16Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Value = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I16 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TI16Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Value = &v +} + return nil } func (p *TI16Value) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI16Value"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TI16Value"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TI16Value) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.I16, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) - } - if err := oprot.WriteI16(ctx, int16(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) - } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.I16, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } + if err := oprot.WriteI16(ctx, int16(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } + } + return err } func (p *TI16Value) Equals(other *TI16Value) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true } func (p *TI16Value) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TI16Value(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI16Value(%+v)", *p) } func (p *TI16Value) Validate() error { - return nil + return nil } - // Attributes: -// - Value +// - Value type TI32Value struct { - Value *int32 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *int32 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTI32Value() *TI32Value { - return &TI32Value{} + return &TI32Value{} } var TI32Value_Value_DEFAULT int32 - func (p *TI32Value) GetValue() int32 { - if !p.IsSetValue() { - return TI32Value_Value_DEFAULT - } - return *p.Value + if !p.IsSetValue() { + return TI32Value_Value_DEFAULT + } +return *p.Value } func (p *TI32Value) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TI32Value) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TI32Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Value = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TI32Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Value = &v +} + return nil } func (p *TI32Value) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI32Value"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TI32Value"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TI32Value) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) - } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } + } + return err } func (p *TI32Value) Equals(other *TI32Value) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true } func (p *TI32Value) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TI32Value(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI32Value(%+v)", *p) } func (p *TI32Value) Validate() error { - return nil + return nil } - // Attributes: -// - Value +// - Value type TI64Value struct { - Value *int64 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *int64 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTI64Value() *TI64Value { - return &TI64Value{} + return &TI64Value{} } var TI64Value_Value_DEFAULT int64 - func (p *TI64Value) GetValue() int64 { - if !p.IsSetValue() { - return TI64Value_Value_DEFAULT - } - return *p.Value + if !p.IsSetValue() { + return TI64Value_Value_DEFAULT + } +return *p.Value } func (p *TI64Value) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TI64Value) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TI64Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Value = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TI64Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Value = &v +} + return nil } func (p *TI64Value) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI64Value"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TI64Value"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TI64Value) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) - } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } + } + return err } func (p *TI64Value) Equals(other *TI64Value) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true } func (p *TI64Value) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TI64Value(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI64Value(%+v)", *p) } func (p *TI64Value) Validate() error { - return nil + return nil } - // Attributes: -// - Value +// - Value type TDoubleValue struct { - Value *float64 `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *float64 `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTDoubleValue() *TDoubleValue { - return &TDoubleValue{} + return &TDoubleValue{} } var TDoubleValue_Value_DEFAULT float64 - func (p *TDoubleValue) GetValue() float64 { - if !p.IsSetValue() { - return TDoubleValue_Value_DEFAULT - } - return *p.Value + if !p.IsSetValue() { + return TDoubleValue_Value_DEFAULT + } +return *p.Value } func (p *TDoubleValue) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TDoubleValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TDoubleValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Value = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TDoubleValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Value = &v +} + return nil } func (p *TDoubleValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TDoubleValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TDoubleValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TDoubleValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.DOUBLE, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) - } - if err := oprot.WriteDouble(ctx, float64(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) - } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.DOUBLE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } + if err := oprot.WriteDouble(ctx, float64(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } + } + return err } func (p *TDoubleValue) Equals(other *TDoubleValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true } func (p *TDoubleValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDoubleValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TDoubleValue(%+v)", *p) } func (p *TDoubleValue) Validate() error { - return nil + return nil } - // Attributes: -// - Value +// - Value type TStringValue struct { - Value *string `thrift:"value,1" db:"value" json:"value,omitempty"` + Value *string `thrift:"value,1" db:"value" json:"value,omitempty"` } func NewTStringValue() *TStringValue { - return &TStringValue{} + return &TStringValue{} } var TStringValue_Value_DEFAULT string - func (p *TStringValue) GetValue() string { - if !p.IsSetValue() { - return TStringValue_Value_DEFAULT - } - return *p.Value + if !p.IsSetValue() { + return TStringValue_Value_DEFAULT + } +return *p.Value } func (p *TStringValue) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TStringValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TStringValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Value = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TStringValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Value = &v +} + return nil } func (p *TStringValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStringValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TStringValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TStringValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) - } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) } + } + return err } func (p *TStringValue) Equals(other *TStringValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true } func (p *TStringValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TStringValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TStringValue(%+v)", *p) } func (p *TStringValue) Validate() error { - return nil + return nil } - // Attributes: -// - BoolVal -// - ByteVal -// - I16Val -// - I32Val -// - I64Val -// - DoubleVal -// - StringVal +// - BoolVal +// - ByteVal +// - I16Val +// - I32Val +// - I64Val +// - DoubleVal +// - StringVal type TColumnValue struct { - BoolVal *TBoolValue `thrift:"boolVal,1" db:"boolVal" json:"boolVal,omitempty"` - ByteVal *TByteValue `thrift:"byteVal,2" db:"byteVal" json:"byteVal,omitempty"` - I16Val *TI16Value `thrift:"i16Val,3" db:"i16Val" json:"i16Val,omitempty"` - I32Val *TI32Value `thrift:"i32Val,4" db:"i32Val" json:"i32Val,omitempty"` - I64Val *TI64Value `thrift:"i64Val,5" db:"i64Val" json:"i64Val,omitempty"` - DoubleVal *TDoubleValue `thrift:"doubleVal,6" db:"doubleVal" json:"doubleVal,omitempty"` - StringVal *TStringValue `thrift:"stringVal,7" db:"stringVal" json:"stringVal,omitempty"` + BoolVal *TBoolValue `thrift:"boolVal,1" db:"boolVal" json:"boolVal,omitempty"` + ByteVal *TByteValue `thrift:"byteVal,2" db:"byteVal" json:"byteVal,omitempty"` + I16Val *TI16Value `thrift:"i16Val,3" db:"i16Val" json:"i16Val,omitempty"` + I32Val *TI32Value `thrift:"i32Val,4" db:"i32Val" json:"i32Val,omitempty"` + I64Val *TI64Value `thrift:"i64Val,5" db:"i64Val" json:"i64Val,omitempty"` + DoubleVal *TDoubleValue `thrift:"doubleVal,6" db:"doubleVal" json:"doubleVal,omitempty"` + StringVal *TStringValue `thrift:"stringVal,7" db:"stringVal" json:"stringVal,omitempty"` } func NewTColumnValue() *TColumnValue { - return &TColumnValue{} + return &TColumnValue{} } var TColumnValue_BoolVal_DEFAULT *TBoolValue - func (p *TColumnValue) GetBoolVal() *TBoolValue { - if !p.IsSetBoolVal() { - return TColumnValue_BoolVal_DEFAULT - } - return p.BoolVal + if !p.IsSetBoolVal() { + return TColumnValue_BoolVal_DEFAULT + } +return p.BoolVal } - var TColumnValue_ByteVal_DEFAULT *TByteValue - func (p *TColumnValue) GetByteVal() *TByteValue { - if !p.IsSetByteVal() { - return TColumnValue_ByteVal_DEFAULT - } - return p.ByteVal + if !p.IsSetByteVal() { + return TColumnValue_ByteVal_DEFAULT + } +return p.ByteVal } - var TColumnValue_I16Val_DEFAULT *TI16Value - func (p *TColumnValue) GetI16Val() *TI16Value { - if !p.IsSetI16Val() { - return TColumnValue_I16Val_DEFAULT - } - return p.I16Val + if !p.IsSetI16Val() { + return TColumnValue_I16Val_DEFAULT + } +return p.I16Val } - var TColumnValue_I32Val_DEFAULT *TI32Value - func (p *TColumnValue) GetI32Val() *TI32Value { - if !p.IsSetI32Val() { - return TColumnValue_I32Val_DEFAULT - } - return p.I32Val + if !p.IsSetI32Val() { + return TColumnValue_I32Val_DEFAULT + } +return p.I32Val } - var TColumnValue_I64Val_DEFAULT *TI64Value - func (p *TColumnValue) GetI64Val() *TI64Value { - if !p.IsSetI64Val() { - return TColumnValue_I64Val_DEFAULT - } - return p.I64Val + if !p.IsSetI64Val() { + return TColumnValue_I64Val_DEFAULT + } +return p.I64Val } - var TColumnValue_DoubleVal_DEFAULT *TDoubleValue - func (p *TColumnValue) GetDoubleVal() *TDoubleValue { - if !p.IsSetDoubleVal() { - return TColumnValue_DoubleVal_DEFAULT - } - return p.DoubleVal + if !p.IsSetDoubleVal() { + return TColumnValue_DoubleVal_DEFAULT + } +return p.DoubleVal } - var TColumnValue_StringVal_DEFAULT *TStringValue - func (p *TColumnValue) GetStringVal() *TStringValue { - if !p.IsSetStringVal() { - return TColumnValue_StringVal_DEFAULT - } - return p.StringVal + if !p.IsSetStringVal() { + return TColumnValue_StringVal_DEFAULT + } +return p.StringVal } func (p *TColumnValue) CountSetFieldsTColumnValue() int { - count := 0 - if p.IsSetBoolVal() { - count++ - } - if p.IsSetByteVal() { - count++ - } - if p.IsSetI16Val() { - count++ - } - if p.IsSetI32Val() { - count++ - } - if p.IsSetI64Val() { - count++ - } - if p.IsSetDoubleVal() { - count++ - } - if p.IsSetStringVal() { - count++ - } - return count + count := 0 + if (p.IsSetBoolVal()) { + count++ + } + if (p.IsSetByteVal()) { + count++ + } + if (p.IsSetI16Val()) { + count++ + } + if (p.IsSetI32Val()) { + count++ + } + if (p.IsSetI64Val()) { + count++ + } + if (p.IsSetDoubleVal()) { + count++ + } + if (p.IsSetStringVal()) { + count++ + } + return count } func (p *TColumnValue) IsSetBoolVal() bool { - return p.BoolVal != nil + return p.BoolVal != nil } func (p *TColumnValue) IsSetByteVal() bool { - return p.ByteVal != nil + return p.ByteVal != nil } func (p *TColumnValue) IsSetI16Val() bool { - return p.I16Val != nil + return p.I16Val != nil } func (p *TColumnValue) IsSetI32Val() bool { - return p.I32Val != nil + return p.I32Val != nil } func (p *TColumnValue) IsSetI64Val() bool { - return p.I64Val != nil + return p.I64Val != nil } func (p *TColumnValue) IsSetDoubleVal() bool { - return p.DoubleVal != nil + return p.DoubleVal != nil } func (p *TColumnValue) IsSetStringVal() bool { - return p.StringVal != nil + return p.StringVal != nil } func (p *TColumnValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TColumnValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.BoolVal = &TBoolValue{} - if err := p.BoolVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err) - } - return nil -} - -func (p *TColumnValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ByteVal = &TByteValue{} - if err := p.ByteVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err) - } - return nil -} - -func (p *TColumnValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.I16Val = &TI16Value{} - if err := p.I16Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err) - } - return nil -} - -func (p *TColumnValue) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.I32Val = &TI32Value{} - if err := p.I32Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err) - } - return nil -} - -func (p *TColumnValue) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - p.I64Val = &TI64Value{} - if err := p.I64Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err) - } - return nil -} - -func (p *TColumnValue) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - p.DoubleVal = &TDoubleValue{} - if err := p.DoubleVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err) - } - return nil -} - -func (p *TColumnValue) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - p.StringVal = &TStringValue{} - if err := p.StringVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TColumnValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.BoolVal = &TBoolValue{} + if err := p.BoolVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err) + } + return nil +} + +func (p *TColumnValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.ByteVal = &TByteValue{} + if err := p.ByteVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err) + } + return nil +} + +func (p *TColumnValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.I16Val = &TI16Value{} + if err := p.I16Val.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err) + } + return nil +} + +func (p *TColumnValue) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.I32Val = &TI32Value{} + if err := p.I32Val.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err) + } + return nil +} + +func (p *TColumnValue) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + p.I64Val = &TI64Value{} + if err := p.I64Val.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err) + } + return nil +} + +func (p *TColumnValue) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + p.DoubleVal = &TDoubleValue{} + if err := p.DoubleVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err) + } + return nil +} + +func (p *TColumnValue) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + p.StringVal = &TStringValue{} + if err := p.StringVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err) + } + return nil } func (p *TColumnValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTColumnValue(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TColumnValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - if err := p.writeField6(ctx, oprot); err != nil { - return err - } - if err := p.writeField7(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if c := p.CountSetFieldsTColumnValue(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TColumnValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TColumnValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBoolVal() { - if err := oprot.WriteFieldBegin(ctx, "boolVal", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:boolVal: ", p), err) - } - if err := p.BoolVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) - } - } - return err + if p.IsSetBoolVal() { + if err := oprot.WriteFieldBegin(ctx, "boolVal", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:boolVal: ", p), err) } + if err := p.BoolVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) } + } + return err } func (p *TColumnValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetByteVal() { - if err := oprot.WriteFieldBegin(ctx, "byteVal", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:byteVal: ", p), err) - } - if err := p.ByteVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) - } - } - return err + if p.IsSetByteVal() { + if err := oprot.WriteFieldBegin(ctx, "byteVal", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:byteVal: ", p), err) } + if err := p.ByteVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) } + } + return err } func (p *TColumnValue) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI16Val() { - if err := oprot.WriteFieldBegin(ctx, "i16Val", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i16Val: ", p), err) - } - if err := p.I16Val.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) - } - } - return err + if p.IsSetI16Val() { + if err := oprot.WriteFieldBegin(ctx, "i16Val", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i16Val: ", p), err) } + if err := p.I16Val.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) } + } + return err } func (p *TColumnValue) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI32Val() { - if err := oprot.WriteFieldBegin(ctx, "i32Val", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:i32Val: ", p), err) - } - if err := p.I32Val.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) - } - } - return err + if p.IsSetI32Val() { + if err := oprot.WriteFieldBegin(ctx, "i32Val", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:i32Val: ", p), err) } + if err := p.I32Val.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) } + } + return err } func (p *TColumnValue) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI64Val() { - if err := oprot.WriteFieldBegin(ctx, "i64Val", thrift.STRUCT, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:i64Val: ", p), err) - } - if err := p.I64Val.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) - } - } - return err + if p.IsSetI64Val() { + if err := oprot.WriteFieldBegin(ctx, "i64Val", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:i64Val: ", p), err) } + if err := p.I64Val.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) } + } + return err } func (p *TColumnValue) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDoubleVal() { - if err := oprot.WriteFieldBegin(ctx, "doubleVal", thrift.STRUCT, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:doubleVal: ", p), err) - } - if err := p.DoubleVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) - } - } - return err + if p.IsSetDoubleVal() { + if err := oprot.WriteFieldBegin(ctx, "doubleVal", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:doubleVal: ", p), err) } + if err := p.DoubleVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) } + } + return err } func (p *TColumnValue) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringVal() { - if err := oprot.WriteFieldBegin(ctx, "stringVal", thrift.STRUCT, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stringVal: ", p), err) - } - if err := p.StringVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) - } - } - return err + if p.IsSetStringVal() { + if err := oprot.WriteFieldBegin(ctx, "stringVal", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stringVal: ", p), err) } + if err := p.StringVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) } + } + return err } func (p *TColumnValue) Equals(other *TColumnValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.BoolVal.Equals(other.BoolVal) { - return false - } - if !p.ByteVal.Equals(other.ByteVal) { - return false - } - if !p.I16Val.Equals(other.I16Val) { - return false - } - if !p.I32Val.Equals(other.I32Val) { - return false - } - if !p.I64Val.Equals(other.I64Val) { - return false - } - if !p.DoubleVal.Equals(other.DoubleVal) { - return false - } - if !p.StringVal.Equals(other.StringVal) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.BoolVal.Equals(other.BoolVal) { return false } + if !p.ByteVal.Equals(other.ByteVal) { return false } + if !p.I16Val.Equals(other.I16Val) { return false } + if !p.I32Val.Equals(other.I32Val) { return false } + if !p.I64Val.Equals(other.I64Val) { return false } + if !p.DoubleVal.Equals(other.DoubleVal) { return false } + if !p.StringVal.Equals(other.StringVal) { return false } + return true } func (p *TColumnValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TColumnValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TColumnValue(%+v)", *p) } func (p *TColumnValue) Validate() error { - return nil + return nil } - // Attributes: -// - ColVals +// - ColVals type TRow struct { - ColVals []*TColumnValue `thrift:"colVals,1,required" db:"colVals" json:"colVals"` + ColVals []*TColumnValue `thrift:"colVals,1,required" db:"colVals" json:"colVals"` } func NewTRow() *TRow { - return &TRow{} + return &TRow{} } + func (p *TRow) GetColVals() []*TColumnValue { - return p.ColVals + return p.ColVals } func (p *TRow) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetColVals bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetColVals = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetColVals { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ColVals is not set")) - } - return nil -} - -func (p *TRow) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TColumnValue, 0, size) - p.ColVals = tSlice - for i := 0; i < size; i++ { - _elem13 := &TColumnValue{} - if err := _elem13.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) - } - p.ColVals = append(p.ColVals, _elem13) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetColVals bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetColVals = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetColVals{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ColVals is not set")); + } + return nil +} + +func (p *TRow) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TColumnValue, 0, size) + p.ColVals = tSlice + for i := 0; i < size; i ++ { + _elem13 := &TColumnValue{} + if err := _elem13.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) + } + p.ColVals = append(p.ColVals, _elem13) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TRow) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TRow"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TRow"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TRow) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "colVals", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:colVals: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ColVals)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.ColVals { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:colVals: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "colVals", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:colVals: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ColVals)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ColVals { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:colVals: ", p), err) } + return err } func (p *TRow) Equals(other *TRow) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.ColVals) != len(other.ColVals) { - return false - } - for i, _tgt := range p.ColVals { - _src14 := other.ColVals[i] - if !_tgt.Equals(_src14) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.ColVals) != len(other.ColVals) { return false } + for i, _tgt := range p.ColVals { + _src14 := other.ColVals[i] + if !_tgt.Equals(_src14) { return false } + } + return true } func (p *TRow) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TRow(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TRow(%+v)", *p) } func (p *TRow) Validate() error { - return nil + return nil } - // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TBoolColumn struct { - Values []bool `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []bool `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTBoolColumn() *TBoolColumn { - return &TBoolColumn{} + return &TBoolColumn{} } + func (p *TBoolColumn) GetValues() []bool { - return p.Values + return p.Values } func (p *TBoolColumn) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TBoolColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false - var issetNulls bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) - } - if !issetNulls { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) - } - return nil -} - -func (p *TBoolColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]bool, 0, size) - p.Values = tSlice - for i := 0; i < size; i++ { - var _elem15 bool - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem15 = v - } - p.Values = append(p.Values, _elem15) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TBoolColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Nulls = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false; + var issetNulls bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); + } + if !issetNulls{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); + } + return nil +} + +func (p *TBoolColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]bool, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { +var _elem15 bool + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem15 = v +} + p.Values = append(p.Values, _elem15) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TBoolColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Nulls = v +} + return nil } func (p *TBoolColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TBoolColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TBoolColumn"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TBoolColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteBool(ctx, bool(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteBool(ctx, bool(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err } func (p *TBoolColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) - } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } + return err } func (p *TBoolColumn) Equals(other *TBoolColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { - return false - } - for i, _tgt := range p.Values { - _src16 := other.Values[i] - if _tgt != _src16 { - return false - } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src16 := other.Values[i] + if _tgt != _src16 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true } func (p *TBoolColumn) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TBoolColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TBoolColumn(%+v)", *p) } func (p *TBoolColumn) Validate() error { - return nil + return nil } - // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TByteColumn struct { - Values []int8 `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []int8 `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTByteColumn() *TByteColumn { - return &TByteColumn{} + return &TByteColumn{} } + func (p *TByteColumn) GetValues() []int8 { - return p.Values + return p.Values } func (p *TByteColumn) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TByteColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false - var issetNulls bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) - } - if !issetNulls { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) - } - return nil -} - -func (p *TByteColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]int8, 0, size) - p.Values = tSlice - for i := 0; i < size; i++ { - var _elem17 int8 - if v, err := iprot.ReadByte(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := int8(v) - _elem17 = temp - } - p.Values = append(p.Values, _elem17) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TByteColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Nulls = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false; + var issetNulls bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); + } + if !issetNulls{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); + } + return nil +} + +func (p *TByteColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int8, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { +var _elem17 int8 + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := int8(v) + _elem17 = temp +} + p.Values = append(p.Values, _elem17) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TByteColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Nulls = v +} + return nil } func (p *TByteColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TByteColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TByteColumn"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TByteColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.BYTE, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteByte(ctx, int8(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.BYTE, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteByte(ctx, int8(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err } func (p *TByteColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) - } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } + return err } func (p *TByteColumn) Equals(other *TByteColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { - return false - } - for i, _tgt := range p.Values { - _src18 := other.Values[i] - if _tgt != _src18 { - return false - } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src18 := other.Values[i] + if _tgt != _src18 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true } func (p *TByteColumn) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TByteColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TByteColumn(%+v)", *p) } func (p *TByteColumn) Validate() error { - return nil + return nil } - // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TI16Column struct { - Values []int16 `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []int16 `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTI16Column() *TI16Column { - return &TI16Column{} + return &TI16Column{} } + func (p *TI16Column) GetValues() []int16 { - return p.Values + return p.Values } func (p *TI16Column) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TI16Column) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false - var issetNulls bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) - } - if !issetNulls { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) - } - return nil -} - -func (p *TI16Column) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]int16, 0, size) - p.Values = tSlice - for i := 0; i < size; i++ { - var _elem19 int16 - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem19 = v - } - p.Values = append(p.Values, _elem19) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TI16Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Nulls = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false; + var issetNulls bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); + } + if !issetNulls{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); + } + return nil +} + +func (p *TI16Column) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int16, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { +var _elem19 int16 + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem19 = v +} + p.Values = append(p.Values, _elem19) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TI16Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Nulls = v +} + return nil } func (p *TI16Column) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI16Column"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TI16Column"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TI16Column) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.I16, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteI16(ctx, int16(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I16, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteI16(ctx, int16(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err } func (p *TI16Column) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) - } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } + return err } func (p *TI16Column) Equals(other *TI16Column) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { - return false - } - for i, _tgt := range p.Values { - _src20 := other.Values[i] - if _tgt != _src20 { - return false - } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src20 := other.Values[i] + if _tgt != _src20 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true } func (p *TI16Column) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TI16Column(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI16Column(%+v)", *p) } func (p *TI16Column) Validate() error { - return nil + return nil } - // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TI32Column struct { - Values []int32 `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []int32 `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTI32Column() *TI32Column { - return &TI32Column{} + return &TI32Column{} } + func (p *TI32Column) GetValues() []int32 { - return p.Values + return p.Values } func (p *TI32Column) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TI32Column) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false - var issetNulls bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) - } - if !issetNulls { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) - } - return nil -} - -func (p *TI32Column) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]int32, 0, size) - p.Values = tSlice - for i := 0; i < size; i++ { - var _elem21 int32 - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem21 = v - } - p.Values = append(p.Values, _elem21) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TI32Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Nulls = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false; + var issetNulls bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); + } + if !issetNulls{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); + } + return nil +} + +func (p *TI32Column) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int32, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { +var _elem21 int32 + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem21 = v +} + p.Values = append(p.Values, _elem21) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TI32Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Nulls = v +} + return nil } func (p *TI32Column) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI32Column"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TI32Column"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TI32Column) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteI32(ctx, int32(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err } func (p *TI32Column) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) - } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } + return err } func (p *TI32Column) Equals(other *TI32Column) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { - return false - } - for i, _tgt := range p.Values { - _src22 := other.Values[i] - if _tgt != _src22 { - return false - } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src22 := other.Values[i] + if _tgt != _src22 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true } func (p *TI32Column) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TI32Column(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI32Column(%+v)", *p) } func (p *TI32Column) Validate() error { - return nil + return nil } - // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TI64Column struct { - Values []int64 `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []int64 `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTI64Column() *TI64Column { - return &TI64Column{} + return &TI64Column{} } + func (p *TI64Column) GetValues() []int64 { - return p.Values + return p.Values } func (p *TI64Column) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TI64Column) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false - var issetNulls bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) - } - if !issetNulls { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) - } - return nil -} - -func (p *TI64Column) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]int64, 0, size) - p.Values = tSlice - for i := 0; i < size; i++ { - var _elem23 int64 - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem23 = v - } - p.Values = append(p.Values, _elem23) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TI64Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Nulls = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false; + var issetNulls bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); + } + if !issetNulls{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); + } + return nil +} + +func (p *TI64Column) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]int64, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { +var _elem23 int64 + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem23 = v +} + p.Values = append(p.Values, _elem23) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TI64Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Nulls = v +} + return nil } func (p *TI64Column) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TI64Column"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TI64Column"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TI64Column) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.I64, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteI64(ctx, int64(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I64, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteI64(ctx, int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err } func (p *TI64Column) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) - } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } + return err } func (p *TI64Column) Equals(other *TI64Column) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { - return false - } - for i, _tgt := range p.Values { - _src24 := other.Values[i] - if _tgt != _src24 { - return false - } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src24 := other.Values[i] + if _tgt != _src24 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true } func (p *TI64Column) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TI64Column(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TI64Column(%+v)", *p) } func (p *TI64Column) Validate() error { - return nil + return nil } - // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TDoubleColumn struct { - Values []float64 `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []float64 `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTDoubleColumn() *TDoubleColumn { - return &TDoubleColumn{} + return &TDoubleColumn{} } + func (p *TDoubleColumn) GetValues() []float64 { - return p.Values + return p.Values } func (p *TDoubleColumn) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TDoubleColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false - var issetNulls bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) - } - if !issetNulls { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) - } - return nil -} - -func (p *TDoubleColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]float64, 0, size) - p.Values = tSlice - for i := 0; i < size; i++ { - var _elem25 float64 - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem25 = v - } - p.Values = append(p.Values, _elem25) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TDoubleColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Nulls = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false; + var issetNulls bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); + } + if !issetNulls{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); + } + return nil +} + +func (p *TDoubleColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]float64, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { +var _elem25 float64 + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem25 = v +} + p.Values = append(p.Values, _elem25) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TDoubleColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Nulls = v +} + return nil } func (p *TDoubleColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TDoubleColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TDoubleColumn"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TDoubleColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.DOUBLE, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteDouble(ctx, float64(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.DOUBLE, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteDouble(ctx, float64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err } func (p *TDoubleColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) - } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } + return err } func (p *TDoubleColumn) Equals(other *TDoubleColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { - return false - } - for i, _tgt := range p.Values { - _src26 := other.Values[i] - if _tgt != _src26 { - return false - } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src26 := other.Values[i] + if _tgt != _src26 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true } func (p *TDoubleColumn) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDoubleColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TDoubleColumn(%+v)", *p) } func (p *TDoubleColumn) Validate() error { - return nil + return nil } - // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TStringColumn struct { - Values []string `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values []string `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTStringColumn() *TStringColumn { - return &TStringColumn{} + return &TStringColumn{} } + func (p *TStringColumn) GetValues() []string { - return p.Values + return p.Values } func (p *TStringColumn) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TStringColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false - var issetNulls bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) - } - if !issetNulls { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) - } - return nil -} - -func (p *TStringColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]string, 0, size) - p.Values = tSlice - for i := 0; i < size; i++ { - var _elem27 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem27 = v - } - p.Values = append(p.Values, _elem27) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TStringColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Nulls = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false; + var issetNulls bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); + } + if !issetNulls{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); + } + return nil +} + +func (p *TStringColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { +var _elem27 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem27 = v +} + p.Values = append(p.Values, _elem27) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TStringColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Nulls = v +} + return nil } func (p *TStringColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStringColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TStringColumn"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TStringColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err } func (p *TStringColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) - } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } + return err } func (p *TStringColumn) Equals(other *TStringColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { - return false - } - for i, _tgt := range p.Values { - _src28 := other.Values[i] - if _tgt != _src28 { - return false - } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src28 := other.Values[i] + if _tgt != _src28 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true } func (p *TStringColumn) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TStringColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TStringColumn(%+v)", *p) } func (p *TStringColumn) Validate() error { - return nil + return nil } - // Attributes: -// - Values -// - Nulls +// - Values +// - Nulls type TBinaryColumn struct { - Values [][]byte `thrift:"values,1,required" db:"values" json:"values"` - Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` + Values [][]byte `thrift:"values,1,required" db:"values" json:"values"` + Nulls []byte `thrift:"nulls,2,required" db:"nulls" json:"nulls"` } func NewTBinaryColumn() *TBinaryColumn { - return &TBinaryColumn{} + return &TBinaryColumn{} } + func (p *TBinaryColumn) GetValues() [][]byte { - return p.Values + return p.Values } func (p *TBinaryColumn) GetNulls() []byte { - return p.Nulls + return p.Nulls } func (p *TBinaryColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetValues bool = false - var issetNulls bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetValues = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetNulls = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetValues { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")) - } - if !issetNulls { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")) - } - return nil -} - -func (p *TBinaryColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([][]byte, 0, size) - p.Values = tSlice - for i := 0; i < size; i++ { - var _elem29 []byte - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem29 = v - } - p.Values = append(p.Values, _elem29) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TBinaryColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Nulls = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetValues bool = false; + var issetNulls bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetValues = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNulls = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetValues{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Values is not set")); + } + if !issetNulls{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Nulls is not set")); + } + return nil +} + +func (p *TBinaryColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Values = tSlice + for i := 0; i < size; i ++ { +var _elem29 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem29 = v +} + p.Values = append(p.Values, _elem29) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TBinaryColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Nulls = v +} + return nil } func (p *TBinaryColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TBinaryColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TBinaryColumn"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TBinaryColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Values)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Values { - if err := oprot.WriteBinary(ctx, v); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err } func (p *TBinaryColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) - } - if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } + return err } func (p *TBinaryColumn) Equals(other *TBinaryColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.Values) != len(other.Values) { - return false - } - for i, _tgt := range p.Values { - _src30 := other.Values[i] - if bytes.Compare(_tgt, _src30) != 0 { - return false - } - } - if bytes.Compare(p.Nulls, other.Nulls) != 0 { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src30 := other.Values[i] + if bytes.Compare(_tgt, _src30) != 0 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true } func (p *TBinaryColumn) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TBinaryColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TBinaryColumn(%+v)", *p) } func (p *TBinaryColumn) Validate() error { - return nil + return nil } - // Attributes: -// - BoolVal -// - ByteVal -// - I16Val -// - I32Val -// - I64Val -// - DoubleVal -// - StringVal -// - BinaryVal +// - BoolVal +// - ByteVal +// - I16Val +// - I32Val +// - I64Val +// - DoubleVal +// - StringVal +// - BinaryVal type TColumn struct { - BoolVal *TBoolColumn `thrift:"boolVal,1" db:"boolVal" json:"boolVal,omitempty"` - ByteVal *TByteColumn `thrift:"byteVal,2" db:"byteVal" json:"byteVal,omitempty"` - I16Val *TI16Column `thrift:"i16Val,3" db:"i16Val" json:"i16Val,omitempty"` - I32Val *TI32Column `thrift:"i32Val,4" db:"i32Val" json:"i32Val,omitempty"` - I64Val *TI64Column `thrift:"i64Val,5" db:"i64Val" json:"i64Val,omitempty"` - DoubleVal *TDoubleColumn `thrift:"doubleVal,6" db:"doubleVal" json:"doubleVal,omitempty"` - StringVal *TStringColumn `thrift:"stringVal,7" db:"stringVal" json:"stringVal,omitempty"` - BinaryVal *TBinaryColumn `thrift:"binaryVal,8" db:"binaryVal" json:"binaryVal,omitempty"` + BoolVal *TBoolColumn `thrift:"boolVal,1" db:"boolVal" json:"boolVal,omitempty"` + ByteVal *TByteColumn `thrift:"byteVal,2" db:"byteVal" json:"byteVal,omitempty"` + I16Val *TI16Column `thrift:"i16Val,3" db:"i16Val" json:"i16Val,omitempty"` + I32Val *TI32Column `thrift:"i32Val,4" db:"i32Val" json:"i32Val,omitempty"` + I64Val *TI64Column `thrift:"i64Val,5" db:"i64Val" json:"i64Val,omitempty"` + DoubleVal *TDoubleColumn `thrift:"doubleVal,6" db:"doubleVal" json:"doubleVal,omitempty"` + StringVal *TStringColumn `thrift:"stringVal,7" db:"stringVal" json:"stringVal,omitempty"` + BinaryVal *TBinaryColumn `thrift:"binaryVal,8" db:"binaryVal" json:"binaryVal,omitempty"` } func NewTColumn() *TColumn { - return &TColumn{} + return &TColumn{} } var TColumn_BoolVal_DEFAULT *TBoolColumn - func (p *TColumn) GetBoolVal() *TBoolColumn { - if !p.IsSetBoolVal() { - return TColumn_BoolVal_DEFAULT - } - return p.BoolVal + if !p.IsSetBoolVal() { + return TColumn_BoolVal_DEFAULT + } +return p.BoolVal } - var TColumn_ByteVal_DEFAULT *TByteColumn - func (p *TColumn) GetByteVal() *TByteColumn { - if !p.IsSetByteVal() { - return TColumn_ByteVal_DEFAULT - } - return p.ByteVal + if !p.IsSetByteVal() { + return TColumn_ByteVal_DEFAULT + } +return p.ByteVal } - var TColumn_I16Val_DEFAULT *TI16Column - func (p *TColumn) GetI16Val() *TI16Column { - if !p.IsSetI16Val() { - return TColumn_I16Val_DEFAULT - } - return p.I16Val + if !p.IsSetI16Val() { + return TColumn_I16Val_DEFAULT + } +return p.I16Val } - var TColumn_I32Val_DEFAULT *TI32Column - func (p *TColumn) GetI32Val() *TI32Column { - if !p.IsSetI32Val() { - return TColumn_I32Val_DEFAULT - } - return p.I32Val + if !p.IsSetI32Val() { + return TColumn_I32Val_DEFAULT + } +return p.I32Val } - var TColumn_I64Val_DEFAULT *TI64Column - func (p *TColumn) GetI64Val() *TI64Column { - if !p.IsSetI64Val() { - return TColumn_I64Val_DEFAULT - } - return p.I64Val + if !p.IsSetI64Val() { + return TColumn_I64Val_DEFAULT + } +return p.I64Val } - var TColumn_DoubleVal_DEFAULT *TDoubleColumn - func (p *TColumn) GetDoubleVal() *TDoubleColumn { - if !p.IsSetDoubleVal() { - return TColumn_DoubleVal_DEFAULT - } - return p.DoubleVal + if !p.IsSetDoubleVal() { + return TColumn_DoubleVal_DEFAULT + } +return p.DoubleVal } - var TColumn_StringVal_DEFAULT *TStringColumn - func (p *TColumn) GetStringVal() *TStringColumn { - if !p.IsSetStringVal() { - return TColumn_StringVal_DEFAULT - } - return p.StringVal + if !p.IsSetStringVal() { + return TColumn_StringVal_DEFAULT + } +return p.StringVal } - var TColumn_BinaryVal_DEFAULT *TBinaryColumn - func (p *TColumn) GetBinaryVal() *TBinaryColumn { - if !p.IsSetBinaryVal() { - return TColumn_BinaryVal_DEFAULT - } - return p.BinaryVal + if !p.IsSetBinaryVal() { + return TColumn_BinaryVal_DEFAULT + } +return p.BinaryVal } func (p *TColumn) CountSetFieldsTColumn() int { - count := 0 - if p.IsSetBoolVal() { - count++ - } - if p.IsSetByteVal() { - count++ - } - if p.IsSetI16Val() { - count++ - } - if p.IsSetI32Val() { - count++ - } - if p.IsSetI64Val() { - count++ - } - if p.IsSetDoubleVal() { - count++ - } - if p.IsSetStringVal() { - count++ - } - if p.IsSetBinaryVal() { - count++ - } - return count + count := 0 + if (p.IsSetBoolVal()) { + count++ + } + if (p.IsSetByteVal()) { + count++ + } + if (p.IsSetI16Val()) { + count++ + } + if (p.IsSetI32Val()) { + count++ + } + if (p.IsSetI64Val()) { + count++ + } + if (p.IsSetDoubleVal()) { + count++ + } + if (p.IsSetStringVal()) { + count++ + } + if (p.IsSetBinaryVal()) { + count++ + } + return count } func (p *TColumn) IsSetBoolVal() bool { - return p.BoolVal != nil + return p.BoolVal != nil } func (p *TColumn) IsSetByteVal() bool { - return p.ByteVal != nil + return p.ByteVal != nil } func (p *TColumn) IsSetI16Val() bool { - return p.I16Val != nil + return p.I16Val != nil } func (p *TColumn) IsSetI32Val() bool { - return p.I32Val != nil + return p.I32Val != nil } func (p *TColumn) IsSetI64Val() bool { - return p.I64Val != nil + return p.I64Val != nil } func (p *TColumn) IsSetDoubleVal() bool { - return p.DoubleVal != nil + return p.DoubleVal != nil } func (p *TColumn) IsSetStringVal() bool { - return p.StringVal != nil + return p.StringVal != nil } func (p *TColumn) IsSetBinaryVal() bool { - return p.BinaryVal != nil + return p.BinaryVal != nil } func (p *TColumn) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 8: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField8(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.BoolVal = &TBoolColumn{} - if err := p.BoolVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err) - } - return nil -} - -func (p *TColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ByteVal = &TByteColumn{} - if err := p.ByteVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err) - } - return nil -} - -func (p *TColumn) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.I16Val = &TI16Column{} - if err := p.I16Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err) - } - return nil -} - -func (p *TColumn) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.I32Val = &TI32Column{} - if err := p.I32Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err) - } - return nil -} - -func (p *TColumn) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - p.I64Val = &TI64Column{} - if err := p.I64Val.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err) - } - return nil -} - -func (p *TColumn) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - p.DoubleVal = &TDoubleColumn{} - if err := p.DoubleVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err) - } - return nil -} - -func (p *TColumn) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - p.StringVal = &TStringColumn{} - if err := p.StringVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err) - } - return nil -} - -func (p *TColumn) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { - p.BinaryVal = &TBinaryColumn{} - if err := p.BinaryVal.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BinaryVal), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.BoolVal = &TBoolColumn{} + if err := p.BoolVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err) + } + return nil +} + +func (p *TColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.ByteVal = &TByteColumn{} + if err := p.ByteVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err) + } + return nil +} + +func (p *TColumn) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.I16Val = &TI16Column{} + if err := p.I16Val.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err) + } + return nil +} + +func (p *TColumn) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.I32Val = &TI32Column{} + if err := p.I32Val.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err) + } + return nil +} + +func (p *TColumn) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + p.I64Val = &TI64Column{} + if err := p.I64Val.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err) + } + return nil +} + +func (p *TColumn) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + p.DoubleVal = &TDoubleColumn{} + if err := p.DoubleVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err) + } + return nil +} + +func (p *TColumn) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + p.StringVal = &TStringColumn{} + if err := p.StringVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err) + } + return nil +} + +func (p *TColumn) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + p.BinaryVal = &TBinaryColumn{} + if err := p.BinaryVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BinaryVal), err) + } + return nil } func (p *TColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTColumn(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TColumn"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - if err := p.writeField6(ctx, oprot); err != nil { - return err - } - if err := p.writeField7(ctx, oprot); err != nil { - return err - } - if err := p.writeField8(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if c := p.CountSetFieldsTColumn(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TColumn"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBoolVal() { - if err := oprot.WriteFieldBegin(ctx, "boolVal", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:boolVal: ", p), err) - } - if err := p.BoolVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) - } - } - return err + if p.IsSetBoolVal() { + if err := oprot.WriteFieldBegin(ctx, "boolVal", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:boolVal: ", p), err) } + if err := p.BoolVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) } + } + return err } func (p *TColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetByteVal() { - if err := oprot.WriteFieldBegin(ctx, "byteVal", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:byteVal: ", p), err) - } - if err := p.ByteVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) - } - } - return err + if p.IsSetByteVal() { + if err := oprot.WriteFieldBegin(ctx, "byteVal", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:byteVal: ", p), err) } + if err := p.ByteVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) } + } + return err } func (p *TColumn) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI16Val() { - if err := oprot.WriteFieldBegin(ctx, "i16Val", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i16Val: ", p), err) - } - if err := p.I16Val.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) - } - } - return err + if p.IsSetI16Val() { + if err := oprot.WriteFieldBegin(ctx, "i16Val", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i16Val: ", p), err) } + if err := p.I16Val.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) } + } + return err } func (p *TColumn) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI32Val() { - if err := oprot.WriteFieldBegin(ctx, "i32Val", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:i32Val: ", p), err) - } - if err := p.I32Val.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) - } - } - return err + if p.IsSetI32Val() { + if err := oprot.WriteFieldBegin(ctx, "i32Val", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:i32Val: ", p), err) } + if err := p.I32Val.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) } + } + return err } func (p *TColumn) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetI64Val() { - if err := oprot.WriteFieldBegin(ctx, "i64Val", thrift.STRUCT, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:i64Val: ", p), err) - } - if err := p.I64Val.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) - } - } - return err + if p.IsSetI64Val() { + if err := oprot.WriteFieldBegin(ctx, "i64Val", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:i64Val: ", p), err) } + if err := p.I64Val.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) } + } + return err } func (p *TColumn) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDoubleVal() { - if err := oprot.WriteFieldBegin(ctx, "doubleVal", thrift.STRUCT, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:doubleVal: ", p), err) - } - if err := p.DoubleVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) - } - } - return err + if p.IsSetDoubleVal() { + if err := oprot.WriteFieldBegin(ctx, "doubleVal", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:doubleVal: ", p), err) } + if err := p.DoubleVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) } + } + return err } func (p *TColumn) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringVal() { - if err := oprot.WriteFieldBegin(ctx, "stringVal", thrift.STRUCT, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stringVal: ", p), err) - } - if err := p.StringVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) - } - } - return err + if p.IsSetStringVal() { + if err := oprot.WriteFieldBegin(ctx, "stringVal", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stringVal: ", p), err) } + if err := p.StringVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) } + } + return err } func (p *TColumn) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBinaryVal() { - if err := oprot.WriteFieldBegin(ctx, "binaryVal", thrift.STRUCT, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:binaryVal: ", p), err) - } - if err := p.BinaryVal.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BinaryVal), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:binaryVal: ", p), err) - } - } - return err + if p.IsSetBinaryVal() { + if err := oprot.WriteFieldBegin(ctx, "binaryVal", thrift.STRUCT, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:binaryVal: ", p), err) } + if err := p.BinaryVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BinaryVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:binaryVal: ", p), err) } + } + return err } func (p *TColumn) Equals(other *TColumn) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.BoolVal.Equals(other.BoolVal) { - return false - } - if !p.ByteVal.Equals(other.ByteVal) { - return false - } - if !p.I16Val.Equals(other.I16Val) { - return false - } - if !p.I32Val.Equals(other.I32Val) { - return false - } - if !p.I64Val.Equals(other.I64Val) { - return false - } - if !p.DoubleVal.Equals(other.DoubleVal) { - return false - } - if !p.StringVal.Equals(other.StringVal) { - return false - } - if !p.BinaryVal.Equals(other.BinaryVal) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.BoolVal.Equals(other.BoolVal) { return false } + if !p.ByteVal.Equals(other.ByteVal) { return false } + if !p.I16Val.Equals(other.I16Val) { return false } + if !p.I32Val.Equals(other.I32Val) { return false } + if !p.I64Val.Equals(other.I64Val) { return false } + if !p.DoubleVal.Equals(other.DoubleVal) { return false } + if !p.StringVal.Equals(other.StringVal) { return false } + if !p.BinaryVal.Equals(other.BinaryVal) { return false } + return true } func (p *TColumn) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TColumn(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TColumn(%+v)", *p) } func (p *TColumn) Validate() error { - return nil + return nil } - // Attributes: -// - CompressionCodec +// - CompressionCodec type TDBSqlJsonArrayFormat struct { - CompressionCodec *TDBSqlCompressionCodec `thrift:"compressionCodec,1" db:"compressionCodec" json:"compressionCodec,omitempty"` + CompressionCodec *TDBSqlCompressionCodec `thrift:"compressionCodec,1" db:"compressionCodec" json:"compressionCodec,omitempty"` } func NewTDBSqlJsonArrayFormat() *TDBSqlJsonArrayFormat { - return &TDBSqlJsonArrayFormat{} + return &TDBSqlJsonArrayFormat{} } var TDBSqlJsonArrayFormat_CompressionCodec_DEFAULT TDBSqlCompressionCodec - func (p *TDBSqlJsonArrayFormat) GetCompressionCodec() TDBSqlCompressionCodec { - if !p.IsSetCompressionCodec() { - return TDBSqlJsonArrayFormat_CompressionCodec_DEFAULT - } - return *p.CompressionCodec + if !p.IsSetCompressionCodec() { + return TDBSqlJsonArrayFormat_CompressionCodec_DEFAULT + } +return *p.CompressionCodec } func (p *TDBSqlJsonArrayFormat) IsSetCompressionCodec() bool { - return p.CompressionCodec != nil + return p.CompressionCodec != nil } func (p *TDBSqlJsonArrayFormat) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TDBSqlJsonArrayFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := TDBSqlCompressionCodec(v) - p.CompressionCodec = &temp - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TDBSqlJsonArrayFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := TDBSqlCompressionCodec(v) + p.CompressionCodec = &temp +} + return nil } func (p *TDBSqlJsonArrayFormat) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TDBSqlJsonArrayFormat"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TDBSqlJsonArrayFormat"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TDBSqlJsonArrayFormat) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCompressionCodec() { - if err := oprot.WriteFieldBegin(ctx, "compressionCodec", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:compressionCodec: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.CompressionCodec)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.compressionCodec (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:compressionCodec: ", p), err) - } - } - return err + if p.IsSetCompressionCodec() { + if err := oprot.WriteFieldBegin(ctx, "compressionCodec", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:compressionCodec: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.CompressionCodec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.compressionCodec (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:compressionCodec: ", p), err) } + } + return err } func (p *TDBSqlJsonArrayFormat) Equals(other *TDBSqlJsonArrayFormat) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.CompressionCodec != other.CompressionCodec { - if p.CompressionCodec == nil || other.CompressionCodec == nil { - return false - } - if (*p.CompressionCodec) != (*other.CompressionCodec) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.CompressionCodec != other.CompressionCodec { + if p.CompressionCodec == nil || other.CompressionCodec == nil { + return false + } + if (*p.CompressionCodec) != (*other.CompressionCodec) { return false } + } + return true } func (p *TDBSqlJsonArrayFormat) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDBSqlJsonArrayFormat(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TDBSqlJsonArrayFormat(%+v)", *p) } func (p *TDBSqlJsonArrayFormat) Validate() error { - return nil + return nil } - // Attributes: -// - CompressionCodec +// - CompressionCodec type TDBSqlCsvFormat struct { - CompressionCodec *TDBSqlCompressionCodec `thrift:"compressionCodec,1" db:"compressionCodec" json:"compressionCodec,omitempty"` + CompressionCodec *TDBSqlCompressionCodec `thrift:"compressionCodec,1" db:"compressionCodec" json:"compressionCodec,omitempty"` } func NewTDBSqlCsvFormat() *TDBSqlCsvFormat { - return &TDBSqlCsvFormat{} + return &TDBSqlCsvFormat{} } var TDBSqlCsvFormat_CompressionCodec_DEFAULT TDBSqlCompressionCodec - func (p *TDBSqlCsvFormat) GetCompressionCodec() TDBSqlCompressionCodec { - if !p.IsSetCompressionCodec() { - return TDBSqlCsvFormat_CompressionCodec_DEFAULT - } - return *p.CompressionCodec + if !p.IsSetCompressionCodec() { + return TDBSqlCsvFormat_CompressionCodec_DEFAULT + } +return *p.CompressionCodec } func (p *TDBSqlCsvFormat) IsSetCompressionCodec() bool { - return p.CompressionCodec != nil + return p.CompressionCodec != nil } func (p *TDBSqlCsvFormat) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TDBSqlCsvFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := TDBSqlCompressionCodec(v) - p.CompressionCodec = &temp - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TDBSqlCsvFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := TDBSqlCompressionCodec(v) + p.CompressionCodec = &temp +} + return nil } func (p *TDBSqlCsvFormat) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TDBSqlCsvFormat"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TDBSqlCsvFormat"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TDBSqlCsvFormat) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCompressionCodec() { - if err := oprot.WriteFieldBegin(ctx, "compressionCodec", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:compressionCodec: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.CompressionCodec)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.compressionCodec (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:compressionCodec: ", p), err) - } - } - return err + if p.IsSetCompressionCodec() { + if err := oprot.WriteFieldBegin(ctx, "compressionCodec", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:compressionCodec: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.CompressionCodec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.compressionCodec (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:compressionCodec: ", p), err) } + } + return err } func (p *TDBSqlCsvFormat) Equals(other *TDBSqlCsvFormat) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.CompressionCodec != other.CompressionCodec { - if p.CompressionCodec == nil || other.CompressionCodec == nil { - return false - } - if (*p.CompressionCodec) != (*other.CompressionCodec) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.CompressionCodec != other.CompressionCodec { + if p.CompressionCodec == nil || other.CompressionCodec == nil { + return false + } + if (*p.CompressionCodec) != (*other.CompressionCodec) { return false } + } + return true } func (p *TDBSqlCsvFormat) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDBSqlCsvFormat(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TDBSqlCsvFormat(%+v)", *p) } func (p *TDBSqlCsvFormat) Validate() error { - return nil + return nil } - // Attributes: -// - ArrowLayout -// - CompressionCodec +// - ArrowLayout +// - CompressionCodec type TDBSqlArrowFormat struct { - ArrowLayout *TDBSqlArrowLayout `thrift:"arrowLayout,1" db:"arrowLayout" json:"arrowLayout,omitempty"` - CompressionCodec *TDBSqlCompressionCodec `thrift:"compressionCodec,2" db:"compressionCodec" json:"compressionCodec,omitempty"` + ArrowLayout *TDBSqlArrowLayout `thrift:"arrowLayout,1" db:"arrowLayout" json:"arrowLayout,omitempty"` + CompressionCodec *TDBSqlCompressionCodec `thrift:"compressionCodec,2" db:"compressionCodec" json:"compressionCodec,omitempty"` } func NewTDBSqlArrowFormat() *TDBSqlArrowFormat { - return &TDBSqlArrowFormat{} + return &TDBSqlArrowFormat{} } var TDBSqlArrowFormat_ArrowLayout_DEFAULT TDBSqlArrowLayout - func (p *TDBSqlArrowFormat) GetArrowLayout() TDBSqlArrowLayout { - if !p.IsSetArrowLayout() { - return TDBSqlArrowFormat_ArrowLayout_DEFAULT - } - return *p.ArrowLayout + if !p.IsSetArrowLayout() { + return TDBSqlArrowFormat_ArrowLayout_DEFAULT + } +return *p.ArrowLayout } - var TDBSqlArrowFormat_CompressionCodec_DEFAULT TDBSqlCompressionCodec - func (p *TDBSqlArrowFormat) GetCompressionCodec() TDBSqlCompressionCodec { - if !p.IsSetCompressionCodec() { - return TDBSqlArrowFormat_CompressionCodec_DEFAULT - } - return *p.CompressionCodec + if !p.IsSetCompressionCodec() { + return TDBSqlArrowFormat_CompressionCodec_DEFAULT + } +return *p.CompressionCodec } func (p *TDBSqlArrowFormat) IsSetArrowLayout() bool { - return p.ArrowLayout != nil + return p.ArrowLayout != nil } func (p *TDBSqlArrowFormat) IsSetCompressionCodec() bool { - return p.CompressionCodec != nil + return p.CompressionCodec != nil } func (p *TDBSqlArrowFormat) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TDBSqlArrowFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := TDBSqlArrowLayout(v) - p.ArrowLayout = &temp - } - return nil -} - -func (p *TDBSqlArrowFormat) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TDBSqlCompressionCodec(v) - p.CompressionCodec = &temp - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TDBSqlArrowFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := TDBSqlArrowLayout(v) + p.ArrowLayout = &temp +} + return nil +} + +func (p *TDBSqlArrowFormat) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TDBSqlCompressionCodec(v) + p.CompressionCodec = &temp +} + return nil } func (p *TDBSqlArrowFormat) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TDBSqlArrowFormat"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TDBSqlArrowFormat"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TDBSqlArrowFormat) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArrowLayout() { - if err := oprot.WriteFieldBegin(ctx, "arrowLayout", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:arrowLayout: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.ArrowLayout)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.arrowLayout (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:arrowLayout: ", p), err) - } - } - return err + if p.IsSetArrowLayout() { + if err := oprot.WriteFieldBegin(ctx, "arrowLayout", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:arrowLayout: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.ArrowLayout)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.arrowLayout (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:arrowLayout: ", p), err) } + } + return err } func (p *TDBSqlArrowFormat) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCompressionCodec() { - if err := oprot.WriteFieldBegin(ctx, "compressionCodec", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:compressionCodec: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.CompressionCodec)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.compressionCodec (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:compressionCodec: ", p), err) - } - } - return err + if p.IsSetCompressionCodec() { + if err := oprot.WriteFieldBegin(ctx, "compressionCodec", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:compressionCodec: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.CompressionCodec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.compressionCodec (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:compressionCodec: ", p), err) } + } + return err } func (p *TDBSqlArrowFormat) Equals(other *TDBSqlArrowFormat) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.ArrowLayout != other.ArrowLayout { - if p.ArrowLayout == nil || other.ArrowLayout == nil { - return false - } - if (*p.ArrowLayout) != (*other.ArrowLayout) { - return false - } - } - if p.CompressionCodec != other.CompressionCodec { - if p.CompressionCodec == nil || other.CompressionCodec == nil { - return false - } - if (*p.CompressionCodec) != (*other.CompressionCodec) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ArrowLayout != other.ArrowLayout { + if p.ArrowLayout == nil || other.ArrowLayout == nil { + return false + } + if (*p.ArrowLayout) != (*other.ArrowLayout) { return false } + } + if p.CompressionCodec != other.CompressionCodec { + if p.CompressionCodec == nil || other.CompressionCodec == nil { + return false + } + if (*p.CompressionCodec) != (*other.CompressionCodec) { return false } + } + return true } func (p *TDBSqlArrowFormat) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDBSqlArrowFormat(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TDBSqlArrowFormat(%+v)", *p) } func (p *TDBSqlArrowFormat) Validate() error { - return nil + return nil } - // Attributes: -// - ArrowFormat -// - CsvFormat -// - JsonArrayFormat +// - ArrowFormat +// - CsvFormat +// - JsonArrayFormat type TDBSqlResultFormat struct { - ArrowFormat *TDBSqlArrowFormat `thrift:"arrowFormat,1" db:"arrowFormat" json:"arrowFormat,omitempty"` - CsvFormat *TDBSqlCsvFormat `thrift:"csvFormat,2" db:"csvFormat" json:"csvFormat,omitempty"` - JsonArrayFormat *TDBSqlJsonArrayFormat `thrift:"jsonArrayFormat,3" db:"jsonArrayFormat" json:"jsonArrayFormat,omitempty"` + ArrowFormat *TDBSqlArrowFormat `thrift:"arrowFormat,1" db:"arrowFormat" json:"arrowFormat,omitempty"` + CsvFormat *TDBSqlCsvFormat `thrift:"csvFormat,2" db:"csvFormat" json:"csvFormat,omitempty"` + JsonArrayFormat *TDBSqlJsonArrayFormat `thrift:"jsonArrayFormat,3" db:"jsonArrayFormat" json:"jsonArrayFormat,omitempty"` } func NewTDBSqlResultFormat() *TDBSqlResultFormat { - return &TDBSqlResultFormat{} + return &TDBSqlResultFormat{} } var TDBSqlResultFormat_ArrowFormat_DEFAULT *TDBSqlArrowFormat - func (p *TDBSqlResultFormat) GetArrowFormat() *TDBSqlArrowFormat { - if !p.IsSetArrowFormat() { - return TDBSqlResultFormat_ArrowFormat_DEFAULT - } - return p.ArrowFormat + if !p.IsSetArrowFormat() { + return TDBSqlResultFormat_ArrowFormat_DEFAULT + } +return p.ArrowFormat } - var TDBSqlResultFormat_CsvFormat_DEFAULT *TDBSqlCsvFormat - func (p *TDBSqlResultFormat) GetCsvFormat() *TDBSqlCsvFormat { - if !p.IsSetCsvFormat() { - return TDBSqlResultFormat_CsvFormat_DEFAULT - } - return p.CsvFormat + if !p.IsSetCsvFormat() { + return TDBSqlResultFormat_CsvFormat_DEFAULT + } +return p.CsvFormat } - var TDBSqlResultFormat_JsonArrayFormat_DEFAULT *TDBSqlJsonArrayFormat - func (p *TDBSqlResultFormat) GetJsonArrayFormat() *TDBSqlJsonArrayFormat { - if !p.IsSetJsonArrayFormat() { - return TDBSqlResultFormat_JsonArrayFormat_DEFAULT - } - return p.JsonArrayFormat + if !p.IsSetJsonArrayFormat() { + return TDBSqlResultFormat_JsonArrayFormat_DEFAULT + } +return p.JsonArrayFormat } func (p *TDBSqlResultFormat) CountSetFieldsTDBSqlResultFormat() int { - count := 0 - if p.IsSetArrowFormat() { - count++ - } - if p.IsSetCsvFormat() { - count++ - } - if p.IsSetJsonArrayFormat() { - count++ - } - return count + count := 0 + if (p.IsSetArrowFormat()) { + count++ + } + if (p.IsSetCsvFormat()) { + count++ + } + if (p.IsSetJsonArrayFormat()) { + count++ + } + return count } func (p *TDBSqlResultFormat) IsSetArrowFormat() bool { - return p.ArrowFormat != nil + return p.ArrowFormat != nil } func (p *TDBSqlResultFormat) IsSetCsvFormat() bool { - return p.CsvFormat != nil + return p.CsvFormat != nil } func (p *TDBSqlResultFormat) IsSetJsonArrayFormat() bool { - return p.JsonArrayFormat != nil + return p.JsonArrayFormat != nil } func (p *TDBSqlResultFormat) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TDBSqlResultFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.ArrowFormat = &TDBSqlArrowFormat{} - if err := p.ArrowFormat.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ArrowFormat), err) - } - return nil -} - -func (p *TDBSqlResultFormat) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.CsvFormat = &TDBSqlCsvFormat{} - if err := p.CsvFormat.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CsvFormat), err) - } - return nil -} - -func (p *TDBSqlResultFormat) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.JsonArrayFormat = &TDBSqlJsonArrayFormat{} - if err := p.JsonArrayFormat.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JsonArrayFormat), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TDBSqlResultFormat) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.ArrowFormat = &TDBSqlArrowFormat{} + if err := p.ArrowFormat.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ArrowFormat), err) + } + return nil +} + +func (p *TDBSqlResultFormat) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.CsvFormat = &TDBSqlCsvFormat{} + if err := p.CsvFormat.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CsvFormat), err) + } + return nil +} + +func (p *TDBSqlResultFormat) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.JsonArrayFormat = &TDBSqlJsonArrayFormat{} + if err := p.JsonArrayFormat.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JsonArrayFormat), err) + } + return nil } func (p *TDBSqlResultFormat) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTDBSqlResultFormat(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TDBSqlResultFormat"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if c := p.CountSetFieldsTDBSqlResultFormat(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TDBSqlResultFormat"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TDBSqlResultFormat) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArrowFormat() { - if err := oprot.WriteFieldBegin(ctx, "arrowFormat", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:arrowFormat: ", p), err) - } - if err := p.ArrowFormat.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ArrowFormat), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:arrowFormat: ", p), err) - } - } - return err + if p.IsSetArrowFormat() { + if err := oprot.WriteFieldBegin(ctx, "arrowFormat", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:arrowFormat: ", p), err) } + if err := p.ArrowFormat.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ArrowFormat), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:arrowFormat: ", p), err) } + } + return err } func (p *TDBSqlResultFormat) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCsvFormat() { - if err := oprot.WriteFieldBegin(ctx, "csvFormat", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:csvFormat: ", p), err) - } - if err := p.CsvFormat.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CsvFormat), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:csvFormat: ", p), err) - } - } - return err + if p.IsSetCsvFormat() { + if err := oprot.WriteFieldBegin(ctx, "csvFormat", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:csvFormat: ", p), err) } + if err := p.CsvFormat.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CsvFormat), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:csvFormat: ", p), err) } + } + return err } func (p *TDBSqlResultFormat) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetJsonArrayFormat() { - if err := oprot.WriteFieldBegin(ctx, "jsonArrayFormat", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:jsonArrayFormat: ", p), err) - } - if err := p.JsonArrayFormat.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JsonArrayFormat), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:jsonArrayFormat: ", p), err) - } - } - return err + if p.IsSetJsonArrayFormat() { + if err := oprot.WriteFieldBegin(ctx, "jsonArrayFormat", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:jsonArrayFormat: ", p), err) } + if err := p.JsonArrayFormat.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JsonArrayFormat), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:jsonArrayFormat: ", p), err) } + } + return err } func (p *TDBSqlResultFormat) Equals(other *TDBSqlResultFormat) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.ArrowFormat.Equals(other.ArrowFormat) { - return false - } - if !p.CsvFormat.Equals(other.CsvFormat) { - return false - } - if !p.JsonArrayFormat.Equals(other.JsonArrayFormat) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.ArrowFormat.Equals(other.ArrowFormat) { return false } + if !p.CsvFormat.Equals(other.CsvFormat) { return false } + if !p.JsonArrayFormat.Equals(other.JsonArrayFormat) { return false } + return true } func (p *TDBSqlResultFormat) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDBSqlResultFormat(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TDBSqlResultFormat(%+v)", *p) } func (p *TDBSqlResultFormat) Validate() error { - return nil + return nil } - // Attributes: -// - Batch -// - RowCount +// - Batch +// - RowCount type TSparkArrowBatch struct { - Batch []byte `thrift:"batch,1,required" db:"batch" json:"batch"` - RowCount int64 `thrift:"rowCount,2,required" db:"rowCount" json:"rowCount"` + Batch []byte `thrift:"batch,1,required" db:"batch" json:"batch"` + RowCount int64 `thrift:"rowCount,2,required" db:"rowCount" json:"rowCount"` } func NewTSparkArrowBatch() *TSparkArrowBatch { - return &TSparkArrowBatch{} + return &TSparkArrowBatch{} } + func (p *TSparkArrowBatch) GetBatch() []byte { - return p.Batch + return p.Batch } func (p *TSparkArrowBatch) GetRowCount() int64 { - return p.RowCount + return p.RowCount } func (p *TSparkArrowBatch) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetBatch bool = false - var issetRowCount bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetBatch = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I64 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetRowCount = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetBatch { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Batch is not set")) - } - if !issetRowCount { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field RowCount is not set")) - } - return nil -} - -func (p *TSparkArrowBatch) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Batch = v - } - return nil -} - -func (p *TSparkArrowBatch) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.RowCount = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetBatch bool = false; + var issetRowCount bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetBatch = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetRowCount = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetBatch{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Batch is not set")); + } + if !issetRowCount{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field RowCount is not set")); + } + return nil +} + +func (p *TSparkArrowBatch) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Batch = v +} + return nil +} + +func (p *TSparkArrowBatch) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.RowCount = v +} + return nil } func (p *TSparkArrowBatch) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkArrowBatch"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkArrowBatch"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TSparkArrowBatch) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "batch", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:batch: ", p), err) - } - if err := oprot.WriteBinary(ctx, p.Batch); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.batch (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:batch: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "batch", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:batch: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Batch); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.batch (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:batch: ", p), err) } + return err } func (p *TSparkArrowBatch) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "rowCount", thrift.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rowCount: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(p.RowCount)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.rowCount (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rowCount: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "rowCount", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rowCount: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.RowCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.rowCount (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rowCount: ", p), err) } + return err } func (p *TSparkArrowBatch) Equals(other *TSparkArrowBatch) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if bytes.Compare(p.Batch, other.Batch) != 0 { - return false - } - if p.RowCount != other.RowCount { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Batch, other.Batch) != 0 { return false } + if p.RowCount != other.RowCount { return false } + return true } func (p *TSparkArrowBatch) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkArrowBatch(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkArrowBatch(%+v)", *p) } func (p *TSparkArrowBatch) Validate() error { - return nil + return nil } - // Attributes: -// - FileLink -// - ExpiryTime -// - StartRowOffset -// - RowCount -// - BytesNum -// - HttpHeaders +// - FileLink +// - ExpiryTime +// - StartRowOffset +// - RowCount +// - BytesNum +// - HttpHeaders type TSparkArrowResultLink struct { - FileLink string `thrift:"fileLink,1,required" db:"fileLink" json:"fileLink"` - ExpiryTime int64 `thrift:"expiryTime,2,required" db:"expiryTime" json:"expiryTime"` - StartRowOffset int64 `thrift:"startRowOffset,3,required" db:"startRowOffset" json:"startRowOffset"` - RowCount int64 `thrift:"rowCount,4,required" db:"rowCount" json:"rowCount"` - BytesNum int64 `thrift:"bytesNum,5,required" db:"bytesNum" json:"bytesNum"` - HttpHeaders map[string]string `thrift:"httpHeaders,6" db:"httpHeaders" json:"httpHeaders,omitempty"` + FileLink string `thrift:"fileLink,1,required" db:"fileLink" json:"fileLink"` + ExpiryTime int64 `thrift:"expiryTime,2,required" db:"expiryTime" json:"expiryTime"` + StartRowOffset int64 `thrift:"startRowOffset,3,required" db:"startRowOffset" json:"startRowOffset"` + RowCount int64 `thrift:"rowCount,4,required" db:"rowCount" json:"rowCount"` + BytesNum int64 `thrift:"bytesNum,5,required" db:"bytesNum" json:"bytesNum"` + HttpHeaders map[string]string `thrift:"httpHeaders,6" db:"httpHeaders" json:"httpHeaders,omitempty"` } func NewTSparkArrowResultLink() *TSparkArrowResultLink { - return &TSparkArrowResultLink{} + return &TSparkArrowResultLink{} } + func (p *TSparkArrowResultLink) GetFileLink() string { - return p.FileLink + return p.FileLink } func (p *TSparkArrowResultLink) GetExpiryTime() int64 { - return p.ExpiryTime + return p.ExpiryTime } func (p *TSparkArrowResultLink) GetStartRowOffset() int64 { - return p.StartRowOffset + return p.StartRowOffset } func (p *TSparkArrowResultLink) GetRowCount() int64 { - return p.RowCount + return p.RowCount } func (p *TSparkArrowResultLink) GetBytesNum() int64 { - return p.BytesNum + return p.BytesNum } - var TSparkArrowResultLink_HttpHeaders_DEFAULT map[string]string func (p *TSparkArrowResultLink) GetHttpHeaders() map[string]string { - return p.HttpHeaders + return p.HttpHeaders } func (p *TSparkArrowResultLink) IsSetHttpHeaders() bool { - return p.HttpHeaders != nil + return p.HttpHeaders != nil } func (p *TSparkArrowResultLink) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetFileLink bool = false - var issetExpiryTime bool = false - var issetStartRowOffset bool = false - var issetRowCount bool = false - var issetBytesNum bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetFileLink = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I64 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetExpiryTime = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I64 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetStartRowOffset = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I64 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - issetRowCount = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.I64 { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - issetBytesNum = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.MAP { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetFileLink { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FileLink is not set")) - } - if !issetExpiryTime { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ExpiryTime is not set")) - } - if !issetStartRowOffset { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartRowOffset is not set")) - } - if !issetRowCount { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field RowCount is not set")) - } - if !issetBytesNum { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field BytesNum is not set")) - } - return nil -} - -func (p *TSparkArrowResultLink) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.FileLink = v - } - return nil -} - -func (p *TSparkArrowResultLink) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.ExpiryTime = v - } - return nil -} - -func (p *TSparkArrowResultLink) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.StartRowOffset = v - } - return nil -} - -func (p *TSparkArrowResultLink) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.RowCount = v - } - return nil -} - -func (p *TSparkArrowResultLink) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - p.BytesNum = v - } - return nil -} - -func (p *TSparkArrowResultLink) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]string, size) - p.HttpHeaders = tMap - for i := 0; i < size; i++ { - var _key31 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key31 = v - } - var _val32 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _val32 = v - } - p.HttpHeaders[_key31] = _val32 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetFileLink bool = false; + var issetExpiryTime bool = false; + var issetStartRowOffset bool = false; + var issetRowCount bool = false; + var issetBytesNum bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetFileLink = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetExpiryTime = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetStartRowOffset = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + issetRowCount = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + issetBytesNum = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.MAP { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetFileLink{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FileLink is not set")); + } + if !issetExpiryTime{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ExpiryTime is not set")); + } + if !issetStartRowOffset{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartRowOffset is not set")); + } + if !issetRowCount{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field RowCount is not set")); + } + if !issetBytesNum{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field BytesNum is not set")); + } + return nil +} + +func (p *TSparkArrowResultLink) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.FileLink = v +} + return nil +} + +func (p *TSparkArrowResultLink) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ExpiryTime = v +} + return nil +} + +func (p *TSparkArrowResultLink) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.StartRowOffset = v +} + return nil +} + +func (p *TSparkArrowResultLink) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.RowCount = v +} + return nil +} + +func (p *TSparkArrowResultLink) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.BytesNum = v +} + return nil +} + +func (p *TSparkArrowResultLink) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.HttpHeaders = tMap + for i := 0; i < size; i ++ { +var _key31 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key31 = v +} +var _val32 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val32 = v +} + p.HttpHeaders[_key31] = _val32 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil } func (p *TSparkArrowResultLink) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkArrowResultLink"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - if err := p.writeField6(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkArrowResultLink"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TSparkArrowResultLink) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "fileLink", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:fileLink: ", p), err) - } - if err := oprot.WriteString(ctx, string(p.FileLink)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.fileLink (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:fileLink: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "fileLink", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:fileLink: ", p), err) } + if err := oprot.WriteString(ctx, string(p.FileLink)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fileLink (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:fileLink: ", p), err) } + return err } func (p *TSparkArrowResultLink) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "expiryTime", thrift.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:expiryTime: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(p.ExpiryTime)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.expiryTime (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:expiryTime: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "expiryTime", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:expiryTime: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.ExpiryTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.expiryTime (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:expiryTime: ", p), err) } + return err } func (p *TSparkArrowResultLink) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:startRowOffset: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(p.StartRowOffset)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:startRowOffset: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:startRowOffset: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.StartRowOffset)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:startRowOffset: ", p), err) } + return err } func (p *TSparkArrowResultLink) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "rowCount", thrift.I64, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:rowCount: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(p.RowCount)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.rowCount (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:rowCount: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "rowCount", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:rowCount: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.RowCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.rowCount (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:rowCount: ", p), err) } + return err } func (p *TSparkArrowResultLink) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "bytesNum", thrift.I64, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:bytesNum: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(p.BytesNum)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.bytesNum (5) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:bytesNum: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "bytesNum", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:bytesNum: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.BytesNum)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.bytesNum (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:bytesNum: ", p), err) } + return err } func (p *TSparkArrowResultLink) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetHttpHeaders() { - if err := oprot.WriteFieldBegin(ctx, "httpHeaders", thrift.MAP, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:httpHeaders: ", p), err) - } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.HttpHeaders)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.HttpHeaders { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:httpHeaders: ", p), err) - } - } - return err + if p.IsSetHttpHeaders() { + if err := oprot.WriteFieldBegin(ctx, "httpHeaders", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:httpHeaders: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.HttpHeaders)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.HttpHeaders { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:httpHeaders: ", p), err) } + } + return err } func (p *TSparkArrowResultLink) Equals(other *TSparkArrowResultLink) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.FileLink != other.FileLink { - return false - } - if p.ExpiryTime != other.ExpiryTime { - return false - } - if p.StartRowOffset != other.StartRowOffset { - return false - } - if p.RowCount != other.RowCount { - return false - } - if p.BytesNum != other.BytesNum { - return false - } - if len(p.HttpHeaders) != len(other.HttpHeaders) { - return false - } - for k, _tgt := range p.HttpHeaders { - _src33 := other.HttpHeaders[k] - if _tgt != _src33 { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.FileLink != other.FileLink { return false } + if p.ExpiryTime != other.ExpiryTime { return false } + if p.StartRowOffset != other.StartRowOffset { return false } + if p.RowCount != other.RowCount { return false } + if p.BytesNum != other.BytesNum { return false } + if len(p.HttpHeaders) != len(other.HttpHeaders) { return false } + for k, _tgt := range p.HttpHeaders { + _src33 := other.HttpHeaders[k] + if _tgt != _src33 { return false } + } + return true } func (p *TSparkArrowResultLink) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkArrowResultLink(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkArrowResultLink(%+v)", *p) } func (p *TSparkArrowResultLink) Validate() error { - return nil + return nil } - // Attributes: -// - StartRowOffset -// - Rows -// - Columns -// - BinaryColumns -// - ColumnCount -// - ArrowBatches -// - ResultLinks +// - StartRowOffset +// - Rows +// - Columns +// - BinaryColumns +// - ColumnCount +// - ArrowBatches +// - ResultLinks type TRowSet struct { - StartRowOffset int64 `thrift:"startRowOffset,1,required" db:"startRowOffset" json:"startRowOffset"` - Rows []*TRow `thrift:"rows,2,required" db:"rows" json:"rows"` - Columns []*TColumn `thrift:"columns,3" db:"columns" json:"columns,omitempty"` - BinaryColumns []byte `thrift:"binaryColumns,4" db:"binaryColumns" json:"binaryColumns,omitempty"` - ColumnCount *int32 `thrift:"columnCount,5" db:"columnCount" json:"columnCount,omitempty"` - // unused fields # 6 to 1280 - ArrowBatches []*TSparkArrowBatch `thrift:"arrowBatches,1281" db:"arrowBatches" json:"arrowBatches,omitempty"` - ResultLinks []*TSparkArrowResultLink `thrift:"resultLinks,1282" db:"resultLinks" json:"resultLinks,omitempty"` + StartRowOffset int64 `thrift:"startRowOffset,1,required" db:"startRowOffset" json:"startRowOffset"` + Rows []*TRow `thrift:"rows,2,required" db:"rows" json:"rows"` + Columns []*TColumn `thrift:"columns,3" db:"columns" json:"columns,omitempty"` + BinaryColumns []byte `thrift:"binaryColumns,4" db:"binaryColumns" json:"binaryColumns,omitempty"` + ColumnCount *int32 `thrift:"columnCount,5" db:"columnCount" json:"columnCount,omitempty"` + // unused fields # 6 to 1280 + ArrowBatches []*TSparkArrowBatch `thrift:"arrowBatches,1281" db:"arrowBatches" json:"arrowBatches,omitempty"` + ResultLinks []*TSparkArrowResultLink `thrift:"resultLinks,1282" db:"resultLinks" json:"resultLinks,omitempty"` } func NewTRowSet() *TRowSet { - return &TRowSet{} + return &TRowSet{} } + func (p *TRowSet) GetStartRowOffset() int64 { - return p.StartRowOffset + return p.StartRowOffset } func (p *TRowSet) GetRows() []*TRow { - return p.Rows + return p.Rows } - var TRowSet_Columns_DEFAULT []*TColumn func (p *TRowSet) GetColumns() []*TColumn { - return p.Columns + return p.Columns } - var TRowSet_BinaryColumns_DEFAULT []byte func (p *TRowSet) GetBinaryColumns() []byte { - return p.BinaryColumns + return p.BinaryColumns } - var TRowSet_ColumnCount_DEFAULT int32 - func (p *TRowSet) GetColumnCount() int32 { - if !p.IsSetColumnCount() { - return TRowSet_ColumnCount_DEFAULT - } - return *p.ColumnCount + if !p.IsSetColumnCount() { + return TRowSet_ColumnCount_DEFAULT + } +return *p.ColumnCount } - var TRowSet_ArrowBatches_DEFAULT []*TSparkArrowBatch func (p *TRowSet) GetArrowBatches() []*TSparkArrowBatch { - return p.ArrowBatches + return p.ArrowBatches } - var TRowSet_ResultLinks_DEFAULT []*TSparkArrowResultLink func (p *TRowSet) GetResultLinks() []*TSparkArrowResultLink { - return p.ResultLinks + return p.ResultLinks } func (p *TRowSet) IsSetColumns() bool { - return p.Columns != nil + return p.Columns != nil } func (p *TRowSet) IsSetBinaryColumns() bool { - return p.BinaryColumns != nil + return p.BinaryColumns != nil } func (p *TRowSet) IsSetColumnCount() bool { - return p.ColumnCount != nil + return p.ColumnCount != nil } func (p *TRowSet) IsSetArrowBatches() bool { - return p.ArrowBatches != nil + return p.ArrowBatches != nil } func (p *TRowSet) IsSetResultLinks() bool { - return p.ResultLinks != nil + return p.ResultLinks != nil } func (p *TRowSet) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStartRowOffset bool = false - var issetRows bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStartRowOffset = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.LIST { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetRows = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.LIST { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.I32 { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStartRowOffset { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartRowOffset is not set")) - } - if !issetRows { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")) - } - return nil -} - -func (p *TRowSet) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.StartRowOffset = v - } - return nil -} - -func (p *TRowSet) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TRow, 0, size) - p.Rows = tSlice - for i := 0; i < size; i++ { - _elem34 := &TRow{} - if err := _elem34.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem34), err) - } - p.Rows = append(p.Rows, _elem34) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TRowSet) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TColumn, 0, size) - p.Columns = tSlice - for i := 0; i < size; i++ { - _elem35 := &TColumn{} - if err := _elem35.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) - } - p.Columns = append(p.Columns, _elem35) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TRowSet) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.BinaryColumns = v - } - return nil -} - -func (p *TRowSet) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - p.ColumnCount = &v - } - return nil -} - -func (p *TRowSet) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TSparkArrowBatch, 0, size) - p.ArrowBatches = tSlice - for i := 0; i < size; i++ { - _elem36 := &TSparkArrowBatch{} - if err := _elem36.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem36), err) - } - p.ArrowBatches = append(p.ArrowBatches, _elem36) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TRowSet) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TSparkArrowResultLink, 0, size) - p.ResultLinks = tSlice - for i := 0; i < size; i++ { - _elem37 := &TSparkArrowResultLink{} - if err := _elem37.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem37), err) - } - p.ResultLinks = append(p.ResultLinks, _elem37) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStartRowOffset bool = false; + var issetRows bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStartRowOffset = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetRows = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStartRowOffset{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartRowOffset is not set")); + } + if !issetRows{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")); + } + return nil +} + +func (p *TRowSet) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.StartRowOffset = v +} + return nil +} + +func (p *TRowSet) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TRow, 0, size) + p.Rows = tSlice + for i := 0; i < size; i ++ { + _elem34 := &TRow{} + if err := _elem34.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem34), err) + } + p.Rows = append(p.Rows, _elem34) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TRowSet) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TColumn, 0, size) + p.Columns = tSlice + for i := 0; i < size; i ++ { + _elem35 := &TColumn{} + if err := _elem35.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) + } + p.Columns = append(p.Columns, _elem35) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TRowSet) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.BinaryColumns = v +} + return nil +} + +func (p *TRowSet) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.ColumnCount = &v +} + return nil +} + +func (p *TRowSet) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TSparkArrowBatch, 0, size) + p.ArrowBatches = tSlice + for i := 0; i < size; i ++ { + _elem36 := &TSparkArrowBatch{} + if err := _elem36.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem36), err) + } + p.ArrowBatches = append(p.ArrowBatches, _elem36) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TRowSet) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TSparkArrowResultLink, 0, size) + p.ResultLinks = tSlice + for i := 0; i < size; i ++ { + _elem37 := &TSparkArrowResultLink{} + if err := _elem37.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem37), err) + } + p.ResultLinks = append(p.ResultLinks, _elem37) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TRowSet) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TRowSet"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TRowSet"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TRowSet) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:startRowOffset: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(p.StartRowOffset)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:startRowOffset: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:startRowOffset: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.StartRowOffset)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:startRowOffset: ", p), err) } + return err } func (p *TRowSet) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "rows", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Rows)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Rows { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rows: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "rows", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Rows)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Rows { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rows: ", p), err) } + return err } func (p *TRowSet) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetColumns() { - if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:columns: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Columns)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Columns { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:columns: ", p), err) - } - } - return err + if p.IsSetColumns() { + if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:columns: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Columns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Columns { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:columns: ", p), err) } + } + return err } func (p *TRowSet) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBinaryColumns() { - if err := oprot.WriteFieldBegin(ctx, "binaryColumns", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:binaryColumns: ", p), err) - } - if err := oprot.WriteBinary(ctx, p.BinaryColumns); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.binaryColumns (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:binaryColumns: ", p), err) - } - } - return err + if p.IsSetBinaryColumns() { + if err := oprot.WriteFieldBegin(ctx, "binaryColumns", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:binaryColumns: ", p), err) } + if err := oprot.WriteBinary(ctx, p.BinaryColumns); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.binaryColumns (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:binaryColumns: ", p), err) } + } + return err } func (p *TRowSet) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetColumnCount() { - if err := oprot.WriteFieldBegin(ctx, "columnCount", thrift.I32, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnCount: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.ColumnCount)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.columnCount (5) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnCount: ", p), err) - } - } - return err + if p.IsSetColumnCount() { + if err := oprot.WriteFieldBegin(ctx, "columnCount", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnCount: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.ColumnCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.columnCount (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnCount: ", p), err) } + } + return err } func (p *TRowSet) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArrowBatches() { - if err := oprot.WriteFieldBegin(ctx, "arrowBatches", thrift.LIST, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:arrowBatches: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ArrowBatches)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.ArrowBatches { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:arrowBatches: ", p), err) - } - } - return err + if p.IsSetArrowBatches() { + if err := oprot.WriteFieldBegin(ctx, "arrowBatches", thrift.LIST, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:arrowBatches: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ArrowBatches)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ArrowBatches { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:arrowBatches: ", p), err) } + } + return err } func (p *TRowSet) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResultLinks() { - if err := oprot.WriteFieldBegin(ctx, "resultLinks", thrift.LIST, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:resultLinks: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ResultLinks)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.ResultLinks { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:resultLinks: ", p), err) - } - } - return err + if p.IsSetResultLinks() { + if err := oprot.WriteFieldBegin(ctx, "resultLinks", thrift.LIST, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:resultLinks: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ResultLinks)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ResultLinks { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:resultLinks: ", p), err) } + } + return err } func (p *TRowSet) Equals(other *TRowSet) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.StartRowOffset != other.StartRowOffset { - return false - } - if len(p.Rows) != len(other.Rows) { - return false - } - for i, _tgt := range p.Rows { - _src38 := other.Rows[i] - if !_tgt.Equals(_src38) { - return false - } - } - if len(p.Columns) != len(other.Columns) { - return false - } - for i, _tgt := range p.Columns { - _src39 := other.Columns[i] - if !_tgt.Equals(_src39) { - return false - } - } - if bytes.Compare(p.BinaryColumns, other.BinaryColumns) != 0 { - return false - } - if p.ColumnCount != other.ColumnCount { - if p.ColumnCount == nil || other.ColumnCount == nil { - return false - } - if (*p.ColumnCount) != (*other.ColumnCount) { - return false - } - } - if len(p.ArrowBatches) != len(other.ArrowBatches) { - return false - } - for i, _tgt := range p.ArrowBatches { - _src40 := other.ArrowBatches[i] - if !_tgt.Equals(_src40) { - return false - } - } - if len(p.ResultLinks) != len(other.ResultLinks) { - return false - } - for i, _tgt := range p.ResultLinks { - _src41 := other.ResultLinks[i] - if !_tgt.Equals(_src41) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StartRowOffset != other.StartRowOffset { return false } + if len(p.Rows) != len(other.Rows) { return false } + for i, _tgt := range p.Rows { + _src38 := other.Rows[i] + if !_tgt.Equals(_src38) { return false } + } + if len(p.Columns) != len(other.Columns) { return false } + for i, _tgt := range p.Columns { + _src39 := other.Columns[i] + if !_tgt.Equals(_src39) { return false } + } + if bytes.Compare(p.BinaryColumns, other.BinaryColumns) != 0 { return false } + if p.ColumnCount != other.ColumnCount { + if p.ColumnCount == nil || other.ColumnCount == nil { + return false + } + if (*p.ColumnCount) != (*other.ColumnCount) { return false } + } + if len(p.ArrowBatches) != len(other.ArrowBatches) { return false } + for i, _tgt := range p.ArrowBatches { + _src40 := other.ArrowBatches[i] + if !_tgt.Equals(_src40) { return false } + } + if len(p.ResultLinks) != len(other.ResultLinks) { return false } + for i, _tgt := range p.ResultLinks { + _src41 := other.ResultLinks[i] + if !_tgt.Equals(_src41) { return false } + } + return true } func (p *TRowSet) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TRowSet(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TRowSet(%+v)", *p) } func (p *TRowSet) Validate() error { - return nil + return nil } - // Attributes: -// - StatusCode -// - InfoMessages -// - SqlState -// - ErrorCode -// - ErrorMessage -// - DisplayMessage -// - ErrorDetailsJson +// - StatusCode +// - InfoMessages +// - SqlState +// - ErrorCode +// - ErrorMessage +// - DisplayMessage +// - ErrorDetailsJson type TStatus struct { - StatusCode TStatusCode `thrift:"statusCode,1,required" db:"statusCode" json:"statusCode"` - InfoMessages []string `thrift:"infoMessages,2" db:"infoMessages" json:"infoMessages,omitempty"` - SqlState *string `thrift:"sqlState,3" db:"sqlState" json:"sqlState,omitempty"` - ErrorCode *int32 `thrift:"errorCode,4" db:"errorCode" json:"errorCode,omitempty"` - ErrorMessage *string `thrift:"errorMessage,5" db:"errorMessage" json:"errorMessage,omitempty"` - DisplayMessage *string `thrift:"displayMessage,6" db:"displayMessage" json:"displayMessage,omitempty"` - // unused fields # 7 to 1280 - ErrorDetailsJson *string `thrift:"errorDetailsJson,1281" db:"errorDetailsJson" json:"errorDetailsJson,omitempty"` + StatusCode TStatusCode `thrift:"statusCode,1,required" db:"statusCode" json:"statusCode"` + InfoMessages []string `thrift:"infoMessages,2" db:"infoMessages" json:"infoMessages,omitempty"` + SqlState *string `thrift:"sqlState,3" db:"sqlState" json:"sqlState,omitempty"` + ErrorCode *int32 `thrift:"errorCode,4" db:"errorCode" json:"errorCode,omitempty"` + ErrorMessage *string `thrift:"errorMessage,5" db:"errorMessage" json:"errorMessage,omitempty"` + DisplayMessage *string `thrift:"displayMessage,6" db:"displayMessage" json:"displayMessage,omitempty"` + // unused fields # 7 to 1280 + ErrorDetailsJson *string `thrift:"errorDetailsJson,1281" db:"errorDetailsJson" json:"errorDetailsJson,omitempty"` } func NewTStatus() *TStatus { - return &TStatus{} + return &TStatus{} } + func (p *TStatus) GetStatusCode() TStatusCode { - return p.StatusCode + return p.StatusCode } - var TStatus_InfoMessages_DEFAULT []string func (p *TStatus) GetInfoMessages() []string { - return p.InfoMessages + return p.InfoMessages } - var TStatus_SqlState_DEFAULT string - func (p *TStatus) GetSqlState() string { - if !p.IsSetSqlState() { - return TStatus_SqlState_DEFAULT - } - return *p.SqlState + if !p.IsSetSqlState() { + return TStatus_SqlState_DEFAULT + } +return *p.SqlState } - var TStatus_ErrorCode_DEFAULT int32 - func (p *TStatus) GetErrorCode() int32 { - if !p.IsSetErrorCode() { - return TStatus_ErrorCode_DEFAULT - } - return *p.ErrorCode + if !p.IsSetErrorCode() { + return TStatus_ErrorCode_DEFAULT + } +return *p.ErrorCode } - var TStatus_ErrorMessage_DEFAULT string - func (p *TStatus) GetErrorMessage() string { - if !p.IsSetErrorMessage() { - return TStatus_ErrorMessage_DEFAULT - } - return *p.ErrorMessage + if !p.IsSetErrorMessage() { + return TStatus_ErrorMessage_DEFAULT + } +return *p.ErrorMessage } - var TStatus_DisplayMessage_DEFAULT string - func (p *TStatus) GetDisplayMessage() string { - if !p.IsSetDisplayMessage() { - return TStatus_DisplayMessage_DEFAULT - } - return *p.DisplayMessage + if !p.IsSetDisplayMessage() { + return TStatus_DisplayMessage_DEFAULT + } +return *p.DisplayMessage } - var TStatus_ErrorDetailsJson_DEFAULT string - func (p *TStatus) GetErrorDetailsJson() string { - if !p.IsSetErrorDetailsJson() { - return TStatus_ErrorDetailsJson_DEFAULT - } - return *p.ErrorDetailsJson + if !p.IsSetErrorDetailsJson() { + return TStatus_ErrorDetailsJson_DEFAULT + } +return *p.ErrorDetailsJson } func (p *TStatus) IsSetInfoMessages() bool { - return p.InfoMessages != nil + return p.InfoMessages != nil } func (p *TStatus) IsSetSqlState() bool { - return p.SqlState != nil + return p.SqlState != nil } func (p *TStatus) IsSetErrorCode() bool { - return p.ErrorCode != nil + return p.ErrorCode != nil } func (p *TStatus) IsSetErrorMessage() bool { - return p.ErrorMessage != nil + return p.ErrorMessage != nil } func (p *TStatus) IsSetDisplayMessage() bool { - return p.DisplayMessage != nil + return p.DisplayMessage != nil } func (p *TStatus) IsSetErrorDetailsJson() bool { - return p.ErrorDetailsJson != nil + return p.ErrorDetailsJson != nil } func (p *TStatus) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatusCode bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatusCode = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.LIST { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I32 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRING { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatusCode { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StatusCode is not set")) - } - return nil -} - -func (p *TStatus) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := TStatusCode(v) - p.StatusCode = temp - } - return nil -} - -func (p *TStatus) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]string, 0, size) - p.InfoMessages = tSlice - for i := 0; i < size; i++ { - var _elem42 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem42 = v - } - p.InfoMessages = append(p.InfoMessages, _elem42) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TStatus) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.SqlState = &v - } - return nil -} - -func (p *TStatus) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.ErrorCode = &v - } - return nil -} - -func (p *TStatus) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - p.ErrorMessage = &v - } - return nil -} - -func (p *TStatus) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) - } else { - p.DisplayMessage = &v - } - return nil -} - -func (p *TStatus) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1281: ", err) - } else { - p.ErrorDetailsJson = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatusCode bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatusCode = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatusCode{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StatusCode is not set")); + } + return nil +} + +func (p *TStatus) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := TStatusCode(v) + p.StatusCode = temp +} + return nil +} + +func (p *TStatus) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.InfoMessages = tSlice + for i := 0; i < size; i ++ { +var _elem42 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem42 = v +} + p.InfoMessages = append(p.InfoMessages, _elem42) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TStatus) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SqlState = &v +} + return nil +} + +func (p *TStatus) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.ErrorCode = &v +} + return nil +} + +func (p *TStatus) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.ErrorMessage = &v +} + return nil +} + +func (p *TStatus) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.DisplayMessage = &v +} + return nil +} + +func (p *TStatus) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1281: ", err) +} else { + p.ErrorDetailsJson = &v +} + return nil } func (p *TStatus) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStatus"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - if err := p.writeField6(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TStatus"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TStatus) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "statusCode", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:statusCode: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(p.StatusCode)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.statusCode (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:statusCode: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "statusCode", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:statusCode: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.StatusCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.statusCode (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:statusCode: ", p), err) } + return err } func (p *TStatus) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetInfoMessages() { - if err := oprot.WriteFieldBegin(ctx, "infoMessages", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoMessages: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.InfoMessages)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.InfoMessages { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoMessages: ", p), err) - } - } - return err + if p.IsSetInfoMessages() { + if err := oprot.WriteFieldBegin(ctx, "infoMessages", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoMessages: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.InfoMessages)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.InfoMessages { + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoMessages: ", p), err) } + } + return err } func (p *TStatus) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSqlState() { - if err := oprot.WriteFieldBegin(ctx, "sqlState", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.SqlState)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) - } - } - return err + if p.IsSetSqlState() { + if err := oprot.WriteFieldBegin(ctx, "sqlState", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.SqlState)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) } + } + return err } func (p *TStatus) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorCode() { - if err := oprot.WriteFieldBegin(ctx, "errorCode", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.ErrorCode)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) - } - } - return err + if p.IsSetErrorCode() { + if err := oprot.WriteFieldBegin(ctx, "errorCode", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) } + } + return err } func (p *TStatus) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorMessage() { - if err := oprot.WriteFieldBegin(ctx, "errorMessage", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.ErrorMessage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) - } - } - return err + if p.IsSetErrorMessage() { + if err := oprot.WriteFieldBegin(ctx, "errorMessage", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ErrorMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) } + } + return err } func (p *TStatus) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDisplayMessage() { - if err := oprot.WriteFieldBegin(ctx, "displayMessage", thrift.STRING, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:displayMessage: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.DisplayMessage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.displayMessage (6) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:displayMessage: ", p), err) - } - } - return err + if p.IsSetDisplayMessage() { + if err := oprot.WriteFieldBegin(ctx, "displayMessage", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:displayMessage: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.DisplayMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.displayMessage (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:displayMessage: ", p), err) } + } + return err } func (p *TStatus) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorDetailsJson() { - if err := oprot.WriteFieldBegin(ctx, "errorDetailsJson", thrift.STRING, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:errorDetailsJson: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.ErrorDetailsJson)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorDetailsJson (1281) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:errorDetailsJson: ", p), err) - } - } - return err + if p.IsSetErrorDetailsJson() { + if err := oprot.WriteFieldBegin(ctx, "errorDetailsJson", thrift.STRING, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:errorDetailsJson: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ErrorDetailsJson)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorDetailsJson (1281) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:errorDetailsJson: ", p), err) } + } + return err } func (p *TStatus) Equals(other *TStatus) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.StatusCode != other.StatusCode { - return false - } - if len(p.InfoMessages) != len(other.InfoMessages) { - return false - } - for i, _tgt := range p.InfoMessages { - _src43 := other.InfoMessages[i] - if _tgt != _src43 { - return false - } - } - if p.SqlState != other.SqlState { - if p.SqlState == nil || other.SqlState == nil { - return false - } - if (*p.SqlState) != (*other.SqlState) { - return false - } - } - if p.ErrorCode != other.ErrorCode { - if p.ErrorCode == nil || other.ErrorCode == nil { - return false - } - if (*p.ErrorCode) != (*other.ErrorCode) { - return false - } - } - if p.ErrorMessage != other.ErrorMessage { - if p.ErrorMessage == nil || other.ErrorMessage == nil { - return false - } - if (*p.ErrorMessage) != (*other.ErrorMessage) { - return false - } - } - if p.DisplayMessage != other.DisplayMessage { - if p.DisplayMessage == nil || other.DisplayMessage == nil { - return false - } - if (*p.DisplayMessage) != (*other.DisplayMessage) { - return false - } - } - if p.ErrorDetailsJson != other.ErrorDetailsJson { - if p.ErrorDetailsJson == nil || other.ErrorDetailsJson == nil { - return false - } - if (*p.ErrorDetailsJson) != (*other.ErrorDetailsJson) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StatusCode != other.StatusCode { return false } + if len(p.InfoMessages) != len(other.InfoMessages) { return false } + for i, _tgt := range p.InfoMessages { + _src43 := other.InfoMessages[i] + if _tgt != _src43 { return false } + } + if p.SqlState != other.SqlState { + if p.SqlState == nil || other.SqlState == nil { + return false + } + if (*p.SqlState) != (*other.SqlState) { return false } + } + if p.ErrorCode != other.ErrorCode { + if p.ErrorCode == nil || other.ErrorCode == nil { + return false + } + if (*p.ErrorCode) != (*other.ErrorCode) { return false } + } + if p.ErrorMessage != other.ErrorMessage { + if p.ErrorMessage == nil || other.ErrorMessage == nil { + return false + } + if (*p.ErrorMessage) != (*other.ErrorMessage) { return false } + } + if p.DisplayMessage != other.DisplayMessage { + if p.DisplayMessage == nil || other.DisplayMessage == nil { + return false + } + if (*p.DisplayMessage) != (*other.DisplayMessage) { return false } + } + if p.ErrorDetailsJson != other.ErrorDetailsJson { + if p.ErrorDetailsJson == nil || other.ErrorDetailsJson == nil { + return false + } + if (*p.ErrorDetailsJson) != (*other.ErrorDetailsJson) { return false } + } + return true } func (p *TStatus) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TStatus(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TStatus(%+v)", *p) } func (p *TStatus) Validate() error { - return nil + return nil } - // Attributes: -// - CatalogName -// - SchemaName +// - CatalogName +// - SchemaName type TNamespace struct { - CatalogName *TIdentifier `thrift:"catalogName,1" db:"catalogName" json:"catalogName,omitempty"` - SchemaName *TIdentifier `thrift:"schemaName,2" db:"schemaName" json:"schemaName,omitempty"` + CatalogName *TIdentifier `thrift:"catalogName,1" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TIdentifier `thrift:"schemaName,2" db:"schemaName" json:"schemaName,omitempty"` } func NewTNamespace() *TNamespace { - return &TNamespace{} + return &TNamespace{} } var TNamespace_CatalogName_DEFAULT TIdentifier - func (p *TNamespace) GetCatalogName() TIdentifier { - if !p.IsSetCatalogName() { - return TNamespace_CatalogName_DEFAULT - } - return *p.CatalogName + if !p.IsSetCatalogName() { + return TNamespace_CatalogName_DEFAULT + } +return *p.CatalogName } - var TNamespace_SchemaName_DEFAULT TIdentifier - func (p *TNamespace) GetSchemaName() TIdentifier { - if !p.IsSetSchemaName() { - return TNamespace_SchemaName_DEFAULT - } - return *p.SchemaName + if !p.IsSetSchemaName() { + return TNamespace_SchemaName_DEFAULT + } +return *p.SchemaName } func (p *TNamespace) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TNamespace) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TNamespace) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TNamespace) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := TIdentifier(v) - p.CatalogName = &temp - } - return nil -} - -func (p *TNamespace) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TIdentifier(v) - p.SchemaName = &temp - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TNamespace) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := TIdentifier(v) + p.CatalogName = &temp +} + return nil +} + +func (p *TNamespace) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TIdentifier(v) + p.SchemaName = &temp +} + return nil } func (p *TNamespace) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TNamespace"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TNamespace"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TNamespace) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:catalogName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:catalogName: ", p), err) - } - } - return err + if p.IsSetCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:catalogName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.catalogName (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:catalogName: ", p), err) } + } + return err } func (p *TNamespace) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schemaName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schemaName: ", p), err) - } - } - return err + if p.IsSetSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schemaName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schemaName (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schemaName: ", p), err) } + } + return err } func (p *TNamespace) Equals(other *TNamespace) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { - return false - } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { return false } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { return false } + } + return true } func (p *TNamespace) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TNamespace(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TNamespace(%+v)", *p) } func (p *TNamespace) Validate() error { - return nil + return nil } - // Attributes: -// - GUID -// - Secret +// - GUID +// - Secret type THandleIdentifier struct { - GUID []byte `thrift:"guid,1,required" db:"guid" json:"guid"` - Secret []byte `thrift:"secret,2,required" db:"secret" json:"secret"` + GUID []byte `thrift:"guid,1,required" db:"guid" json:"guid"` + Secret []byte `thrift:"secret,2,required" db:"secret" json:"secret"` } func NewTHandleIdentifier() *THandleIdentifier { - return &THandleIdentifier{} + return &THandleIdentifier{} } + func (p *THandleIdentifier) GetGUID() []byte { - return p.GUID + return p.GUID } func (p *THandleIdentifier) GetSecret() []byte { - return p.Secret + return p.Secret } func (p *THandleIdentifier) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetGUID bool = false - var issetSecret bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetGUID = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetSecret = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetGUID { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field GUID is not set")) - } - if !issetSecret { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Secret is not set")) - } - return nil -} - -func (p *THandleIdentifier) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.GUID = v - } - return nil -} - -func (p *THandleIdentifier) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Secret = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetGUID bool = false; + var issetSecret bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetGUID = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetSecret = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetGUID{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field GUID is not set")); + } + if !issetSecret{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Secret is not set")); + } + return nil +} + +func (p *THandleIdentifier) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.GUID = v +} + return nil +} + +func (p *THandleIdentifier) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Secret = v +} + return nil } func (p *THandleIdentifier) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "THandleIdentifier"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "THandleIdentifier"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *THandleIdentifier) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "guid", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:guid: ", p), err) - } - if err := oprot.WriteBinary(ctx, p.GUID); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.guid (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:guid: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "guid", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:guid: ", p), err) } + if err := oprot.WriteBinary(ctx, p.GUID); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.guid (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:guid: ", p), err) } + return err } func (p *THandleIdentifier) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "secret", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:secret: ", p), err) - } - if err := oprot.WriteBinary(ctx, p.Secret); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.secret (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:secret: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "secret", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:secret: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Secret); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.secret (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:secret: ", p), err) } + return err } func (p *THandleIdentifier) Equals(other *THandleIdentifier) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if bytes.Compare(p.GUID, other.GUID) != 0 { - return false - } - if bytes.Compare(p.Secret, other.Secret) != 0 { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.GUID, other.GUID) != 0 { return false } + if bytes.Compare(p.Secret, other.Secret) != 0 { return false } + return true } func (p *THandleIdentifier) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("THandleIdentifier(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("THandleIdentifier(%+v)", *p) } func (p *THandleIdentifier) Validate() error { - return nil + return nil } - // Attributes: -// - SessionId +// - SessionId type TSessionHandle struct { - SessionId *THandleIdentifier `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` + SessionId *THandleIdentifier `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"` } func NewTSessionHandle() *TSessionHandle { - return &TSessionHandle{} + return &TSessionHandle{} } var TSessionHandle_SessionId_DEFAULT *THandleIdentifier - func (p *TSessionHandle) GetSessionId() *THandleIdentifier { - if !p.IsSetSessionId() { - return TSessionHandle_SessionId_DEFAULT - } - return p.SessionId + if !p.IsSetSessionId() { + return TSessionHandle_SessionId_DEFAULT + } +return p.SessionId } func (p *TSessionHandle) IsSetSessionId() bool { - return p.SessionId != nil + return p.SessionId != nil } func (p *TSessionHandle) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionId bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionId = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionId { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")) - } - return nil -} - -func (p *TSessionHandle) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionId = &THandleIdentifier{} - if err := p.SessionId.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionId), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionId bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionId = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionId{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set")); + } + return nil +} + +func (p *TSessionHandle) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionId = &THandleIdentifier{} + if err := p.SessionId.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionId), err) + } + return nil } func (p *TSessionHandle) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSessionHandle"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TSessionHandle"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TSessionHandle) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) - } - if err := p.SessionId.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionId), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := p.SessionId.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionId), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err } func (p *TSessionHandle) Equals(other *TSessionHandle) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionId.Equals(other.SessionId) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionId.Equals(other.SessionId) { return false } + return true } func (p *TSessionHandle) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSessionHandle(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSessionHandle(%+v)", *p) } func (p *TSessionHandle) Validate() error { - return nil + return nil } - // Attributes: -// - OperationId -// - OperationType -// - HasResultSet -// - ModifiedRowCount +// - OperationId +// - OperationType +// - HasResultSet +// - ModifiedRowCount type TOperationHandle struct { - OperationId *THandleIdentifier `thrift:"operationId,1,required" db:"operationId" json:"operationId"` - OperationType TOperationType `thrift:"operationType,2,required" db:"operationType" json:"operationType"` - HasResultSet bool `thrift:"hasResultSet,3,required" db:"hasResultSet" json:"hasResultSet"` - ModifiedRowCount *float64 `thrift:"modifiedRowCount,4" db:"modifiedRowCount" json:"modifiedRowCount,omitempty"` + OperationId *THandleIdentifier `thrift:"operationId,1,required" db:"operationId" json:"operationId"` + OperationType TOperationType `thrift:"operationType,2,required" db:"operationType" json:"operationType"` + HasResultSet bool `thrift:"hasResultSet,3,required" db:"hasResultSet" json:"hasResultSet"` + ModifiedRowCount *float64 `thrift:"modifiedRowCount,4" db:"modifiedRowCount" json:"modifiedRowCount,omitempty"` } func NewTOperationHandle() *TOperationHandle { - return &TOperationHandle{} + return &TOperationHandle{} } var TOperationHandle_OperationId_DEFAULT *THandleIdentifier - func (p *TOperationHandle) GetOperationId() *THandleIdentifier { - if !p.IsSetOperationId() { - return TOperationHandle_OperationId_DEFAULT - } - return p.OperationId + if !p.IsSetOperationId() { + return TOperationHandle_OperationId_DEFAULT + } +return p.OperationId } func (p *TOperationHandle) GetOperationType() TOperationType { - return p.OperationType + return p.OperationType } func (p *TOperationHandle) GetHasResultSet() bool { - return p.HasResultSet + return p.HasResultSet } - var TOperationHandle_ModifiedRowCount_DEFAULT float64 - func (p *TOperationHandle) GetModifiedRowCount() float64 { - if !p.IsSetModifiedRowCount() { - return TOperationHandle_ModifiedRowCount_DEFAULT - } - return *p.ModifiedRowCount + if !p.IsSetModifiedRowCount() { + return TOperationHandle_ModifiedRowCount_DEFAULT + } +return *p.ModifiedRowCount } func (p *TOperationHandle) IsSetOperationId() bool { - return p.OperationId != nil + return p.OperationId != nil } func (p *TOperationHandle) IsSetModifiedRowCount() bool { - return p.ModifiedRowCount != nil + return p.ModifiedRowCount != nil } func (p *TOperationHandle) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationId bool = false - var issetOperationType bool = false - var issetHasResultSet bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperationId = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetOperationType = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetHasResultSet = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationId { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationId is not set")) - } - if !issetOperationType { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationType is not set")) - } - if !issetHasResultSet { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HasResultSet is not set")) - } - return nil -} - -func (p *TOperationHandle) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationId = &THandleIdentifier{} - if err := p.OperationId.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationId), err) - } - return nil -} - -func (p *TOperationHandle) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TOperationType(v) - p.OperationType = temp - } - return nil -} - -func (p *TOperationHandle) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.HasResultSet = v - } - return nil -} - -func (p *TOperationHandle) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.ModifiedRowCount = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperationId bool = false; + var issetOperationType bool = false; + var issetHasResultSet bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationId = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetOperationType = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetHasResultSet = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperationId{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationId is not set")); + } + if !issetOperationType{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationType is not set")); + } + if !issetHasResultSet{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HasResultSet is not set")); + } + return nil +} + +func (p *TOperationHandle) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationId = &THandleIdentifier{} + if err := p.OperationId.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationId), err) + } + return nil +} + +func (p *TOperationHandle) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TOperationType(v) + p.OperationType = temp +} + return nil +} + +func (p *TOperationHandle) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.HasResultSet = v +} + return nil +} + +func (p *TOperationHandle) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.ModifiedRowCount = &v +} + return nil } func (p *TOperationHandle) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TOperationHandle"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TOperationHandle"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TOperationHandle) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationId", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationId: ", p), err) - } - if err := p.OperationId.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationId), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationId: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "operationId", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationId: ", p), err) } + if err := p.OperationId.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationId), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationId: ", p), err) } + return err } func (p *TOperationHandle) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationType", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationType: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(p.OperationType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationType (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationType: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "operationType", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationType: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.OperationType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationType (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationType: ", p), err) } + return err } func (p *TOperationHandle) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "hasResultSet", thrift.BOOL, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hasResultSet: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(p.HasResultSet)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hasResultSet: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "hasResultSet", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hasResultSet: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.HasResultSet)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hasResultSet: ", p), err) } + return err } func (p *TOperationHandle) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetModifiedRowCount() { - if err := oprot.WriteFieldBegin(ctx, "modifiedRowCount", thrift.DOUBLE, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:modifiedRowCount: ", p), err) - } - if err := oprot.WriteDouble(ctx, float64(*p.ModifiedRowCount)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.modifiedRowCount (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:modifiedRowCount: ", p), err) - } - } - return err + if p.IsSetModifiedRowCount() { + if err := oprot.WriteFieldBegin(ctx, "modifiedRowCount", thrift.DOUBLE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:modifiedRowCount: ", p), err) } + if err := oprot.WriteDouble(ctx, float64(*p.ModifiedRowCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.modifiedRowCount (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:modifiedRowCount: ", p), err) } + } + return err } func (p *TOperationHandle) Equals(other *TOperationHandle) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationId.Equals(other.OperationId) { - return false - } - if p.OperationType != other.OperationType { - return false - } - if p.HasResultSet != other.HasResultSet { - return false - } - if p.ModifiedRowCount != other.ModifiedRowCount { - if p.ModifiedRowCount == nil || other.ModifiedRowCount == nil { - return false - } - if (*p.ModifiedRowCount) != (*other.ModifiedRowCount) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationId.Equals(other.OperationId) { return false } + if p.OperationType != other.OperationType { return false } + if p.HasResultSet != other.HasResultSet { return false } + if p.ModifiedRowCount != other.ModifiedRowCount { + if p.ModifiedRowCount == nil || other.ModifiedRowCount == nil { + return false + } + if (*p.ModifiedRowCount) != (*other.ModifiedRowCount) { return false } + } + return true } func (p *TOperationHandle) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TOperationHandle(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TOperationHandle(%+v)", *p) } func (p *TOperationHandle) Validate() error { - return nil + return nil } - // Attributes: -// - ClientProtocol -// - Username -// - Password -// - Configuration -// - GetInfos -// - ClientProtocolI64 -// - ConnectionProperties -// - InitialNamespace -// - CanUseMultipleCatalogs +// - ClientProtocol +// - Username +// - Password +// - Configuration +// - GetInfos +// - ClientProtocolI64 +// - ConnectionProperties +// - InitialNamespace +// - CanUseMultipleCatalogs type TOpenSessionReq struct { - ClientProtocol TProtocolVersion `thrift:"client_protocol,1" db:"client_protocol" json:"client_protocol"` - Username *string `thrift:"username,2" db:"username" json:"username,omitempty"` - Password *string `thrift:"password,3" db:"password" json:"password,omitempty"` - Configuration map[string]string `thrift:"configuration,4" db:"configuration" json:"configuration,omitempty"` - // unused fields # 5 to 1280 - GetInfos []TGetInfoType `thrift:"getInfos,1281" db:"getInfos" json:"getInfos,omitempty"` - ClientProtocolI64 *int64 `thrift:"client_protocol_i64,1282" db:"client_protocol_i64" json:"client_protocol_i64,omitempty"` - ConnectionProperties map[string]string `thrift:"connectionProperties,1283" db:"connectionProperties" json:"connectionProperties,omitempty"` - InitialNamespace *TNamespace `thrift:"initialNamespace,1284" db:"initialNamespace" json:"initialNamespace,omitempty"` - CanUseMultipleCatalogs *bool `thrift:"canUseMultipleCatalogs,1285" db:"canUseMultipleCatalogs" json:"canUseMultipleCatalogs,omitempty"` + ClientProtocol TProtocolVersion `thrift:"client_protocol,1" db:"client_protocol" json:"client_protocol"` + Username *string `thrift:"username,2" db:"username" json:"username,omitempty"` + Password *string `thrift:"password,3" db:"password" json:"password,omitempty"` + Configuration map[string]string `thrift:"configuration,4" db:"configuration" json:"configuration,omitempty"` + // unused fields # 5 to 1280 + GetInfos []TGetInfoType `thrift:"getInfos,1281" db:"getInfos" json:"getInfos,omitempty"` + ClientProtocolI64 *int64 `thrift:"client_protocol_i64,1282" db:"client_protocol_i64" json:"client_protocol_i64,omitempty"` + ConnectionProperties map[string]string `thrift:"connectionProperties,1283" db:"connectionProperties" json:"connectionProperties,omitempty"` + InitialNamespace *TNamespace `thrift:"initialNamespace,1284" db:"initialNamespace" json:"initialNamespace,omitempty"` + CanUseMultipleCatalogs *bool `thrift:"canUseMultipleCatalogs,1285" db:"canUseMultipleCatalogs" json:"canUseMultipleCatalogs,omitempty"` } func NewTOpenSessionReq() *TOpenSessionReq { - return &TOpenSessionReq{ - ClientProtocol: -7, - } + return &TOpenSessionReq{ +ClientProtocol: -7, +} } var TOpenSessionReq_ClientProtocol_DEFAULT TProtocolVersion = -7 func (p *TOpenSessionReq) GetClientProtocol() TProtocolVersion { - return p.ClientProtocol + return p.ClientProtocol } - var TOpenSessionReq_Username_DEFAULT string - func (p *TOpenSessionReq) GetUsername() string { - if !p.IsSetUsername() { - return TOpenSessionReq_Username_DEFAULT - } - return *p.Username + if !p.IsSetUsername() { + return TOpenSessionReq_Username_DEFAULT + } +return *p.Username } - var TOpenSessionReq_Password_DEFAULT string - func (p *TOpenSessionReq) GetPassword() string { - if !p.IsSetPassword() { - return TOpenSessionReq_Password_DEFAULT - } - return *p.Password + if !p.IsSetPassword() { + return TOpenSessionReq_Password_DEFAULT + } +return *p.Password } - var TOpenSessionReq_Configuration_DEFAULT map[string]string func (p *TOpenSessionReq) GetConfiguration() map[string]string { - return p.Configuration + return p.Configuration } - var TOpenSessionReq_GetInfos_DEFAULT []TGetInfoType func (p *TOpenSessionReq) GetGetInfos() []TGetInfoType { - return p.GetInfos + return p.GetInfos } - var TOpenSessionReq_ClientProtocolI64_DEFAULT int64 - func (p *TOpenSessionReq) GetClientProtocolI64() int64 { - if !p.IsSetClientProtocolI64() { - return TOpenSessionReq_ClientProtocolI64_DEFAULT - } - return *p.ClientProtocolI64 + if !p.IsSetClientProtocolI64() { + return TOpenSessionReq_ClientProtocolI64_DEFAULT + } +return *p.ClientProtocolI64 } - var TOpenSessionReq_ConnectionProperties_DEFAULT map[string]string func (p *TOpenSessionReq) GetConnectionProperties() map[string]string { - return p.ConnectionProperties + return p.ConnectionProperties } - var TOpenSessionReq_InitialNamespace_DEFAULT *TNamespace - func (p *TOpenSessionReq) GetInitialNamespace() *TNamespace { - if !p.IsSetInitialNamespace() { - return TOpenSessionReq_InitialNamespace_DEFAULT - } - return p.InitialNamespace + if !p.IsSetInitialNamespace() { + return TOpenSessionReq_InitialNamespace_DEFAULT + } +return p.InitialNamespace } - var TOpenSessionReq_CanUseMultipleCatalogs_DEFAULT bool - func (p *TOpenSessionReq) GetCanUseMultipleCatalogs() bool { - if !p.IsSetCanUseMultipleCatalogs() { - return TOpenSessionReq_CanUseMultipleCatalogs_DEFAULT - } - return *p.CanUseMultipleCatalogs + if !p.IsSetCanUseMultipleCatalogs() { + return TOpenSessionReq_CanUseMultipleCatalogs_DEFAULT + } +return *p.CanUseMultipleCatalogs } func (p *TOpenSessionReq) IsSetClientProtocol() bool { - return p.ClientProtocol != TOpenSessionReq_ClientProtocol_DEFAULT + return p.ClientProtocol != TOpenSessionReq_ClientProtocol_DEFAULT } func (p *TOpenSessionReq) IsSetUsername() bool { - return p.Username != nil + return p.Username != nil } func (p *TOpenSessionReq) IsSetPassword() bool { - return p.Password != nil + return p.Password != nil } func (p *TOpenSessionReq) IsSetConfiguration() bool { - return p.Configuration != nil + return p.Configuration != nil } func (p *TOpenSessionReq) IsSetGetInfos() bool { - return p.GetInfos != nil + return p.GetInfos != nil } func (p *TOpenSessionReq) IsSetClientProtocolI64() bool { - return p.ClientProtocolI64 != nil + return p.ClientProtocolI64 != nil } func (p *TOpenSessionReq) IsSetConnectionProperties() bool { - return p.ConnectionProperties != nil + return p.ConnectionProperties != nil } func (p *TOpenSessionReq) IsSetInitialNamespace() bool { - return p.InitialNamespace != nil + return p.InitialNamespace != nil } func (p *TOpenSessionReq) IsSetCanUseMultipleCatalogs() bool { - return p.CanUseMultipleCatalogs != nil + return p.CanUseMultipleCatalogs != nil } func (p *TOpenSessionReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.MAP { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1283: - if fieldTypeId == thrift.MAP { - if err := p.ReadField1283(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1284: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1284(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1285: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1285(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TOpenSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := TProtocolVersion(v) - p.ClientProtocol = temp - } - return nil -} - -func (p *TOpenSessionReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Username = &v - } - return nil -} - -func (p *TOpenSessionReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.Password = &v - } - return nil -} - -func (p *TOpenSessionReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]string, size) - p.Configuration = tMap - for i := 0; i < size; i++ { - var _key44 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key44 = v - } - var _val45 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _val45 = v - } - p.Configuration[_key44] = _val45 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TOpenSessionReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]TGetInfoType, 0, size) - p.GetInfos = tSlice - for i := 0; i < size; i++ { - var _elem46 TGetInfoType - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := TGetInfoType(v) - _elem46 = temp - } - p.GetInfos = append(p.GetInfos, _elem46) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TOpenSessionReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.ClientProtocolI64 = &v - } - return nil -} - -func (p *TOpenSessionReq) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]string, size) - p.ConnectionProperties = tMap - for i := 0; i < size; i++ { - var _key47 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key47 = v - } - var _val48 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _val48 = v - } - p.ConnectionProperties[_key47] = _val48 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TOpenSessionReq) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { - p.InitialNamespace = &TNamespace{} - if err := p.InitialNamespace.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InitialNamespace), err) - } - return nil -} - -func (p *TOpenSessionReq) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1285: ", err) - } else { - p.CanUseMultipleCatalogs = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.MAP { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1283: + if fieldTypeId == thrift.MAP { + if err := p.ReadField1283(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1284: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1284(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1285: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1285(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TOpenSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := TProtocolVersion(v) + p.ClientProtocol = temp +} + return nil +} + +func (p *TOpenSessionReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Username = &v +} + return nil +} + +func (p *TOpenSessionReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Password = &v +} + return nil +} + +func (p *TOpenSessionReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.Configuration = tMap + for i := 0; i < size; i ++ { +var _key44 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key44 = v +} +var _val45 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val45 = v +} + p.Configuration[_key44] = _val45 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *TOpenSessionReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]TGetInfoType, 0, size) + p.GetInfos = tSlice + for i := 0; i < size; i ++ { +var _elem46 TGetInfoType + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := TGetInfoType(v) + _elem46 = temp +} + p.GetInfos = append(p.GetInfos, _elem46) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TOpenSessionReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.ClientProtocolI64 = &v +} + return nil +} + +func (p *TOpenSessionReq) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.ConnectionProperties = tMap + for i := 0; i < size; i ++ { +var _key47 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key47 = v +} +var _val48 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val48 = v +} + p.ConnectionProperties[_key47] = _val48 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *TOpenSessionReq) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { + p.InitialNamespace = &TNamespace{} + if err := p.InitialNamespace.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InitialNamespace), err) + } + return nil +} + +func (p *TOpenSessionReq) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1285: ", err) +} else { + p.CanUseMultipleCatalogs = &v +} + return nil } func (p *TOpenSessionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TOpenSessionReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - if err := p.writeField1283(ctx, oprot); err != nil { - return err - } - if err := p.writeField1284(ctx, oprot); err != nil { - return err - } - if err := p.writeField1285(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TOpenSessionReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + if err := p.writeField1283(ctx, oprot); err != nil { return err } + if err := p.writeField1284(ctx, oprot); err != nil { return err } + if err := p.writeField1285(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TOpenSessionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetClientProtocol() { - if err := oprot.WriteFieldBegin(ctx, "client_protocol", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:client_protocol: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(p.ClientProtocol)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.client_protocol (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_protocol: ", p), err) - } - } - return err + if p.IsSetClientProtocol() { + if err := oprot.WriteFieldBegin(ctx, "client_protocol", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:client_protocol: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.ClientProtocol)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_protocol (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_protocol: ", p), err) } + } + return err } func (p *TOpenSessionReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetUsername() { - if err := oprot.WriteFieldBegin(ctx, "username", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:username: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.Username)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.username (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:username: ", p), err) - } - } - return err + if p.IsSetUsername() { + if err := oprot.WriteFieldBegin(ctx, "username", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:username: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.Username)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.username (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:username: ", p), err) } + } + return err } func (p *TOpenSessionReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetPassword() { - if err := oprot.WriteFieldBegin(ctx, "password", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:password: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.Password)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.password (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:password: ", p), err) - } - } - return err + if p.IsSetPassword() { + if err := oprot.WriteFieldBegin(ctx, "password", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:password: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.Password)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.password (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:password: ", p), err) } + } + return err } func (p *TOpenSessionReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetConfiguration() { - if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) - } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.Configuration { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) - } - } - return err + if p.IsSetConfiguration() { + if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Configuration { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) } + } + return err } func (p *TOpenSessionReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetInfos() { - if err := oprot.WriteFieldBegin(ctx, "getInfos", thrift.LIST, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getInfos: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.GetInfos)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.GetInfos { - if err := oprot.WriteI32(ctx, int32(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getInfos: ", p), err) - } - } - return err + if p.IsSetGetInfos() { + if err := oprot.WriteFieldBegin(ctx, "getInfos", thrift.LIST, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getInfos: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.GetInfos)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.GetInfos { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getInfos: ", p), err) } + } + return err } func (p *TOpenSessionReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetClientProtocolI64() { - if err := oprot.WriteFieldBegin(ctx, "client_protocol_i64", thrift.I64, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:client_protocol_i64: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.ClientProtocolI64)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.client_protocol_i64 (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:client_protocol_i64: ", p), err) - } - } - return err + if p.IsSetClientProtocolI64() { + if err := oprot.WriteFieldBegin(ctx, "client_protocol_i64", thrift.I64, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:client_protocol_i64: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.ClientProtocolI64)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_protocol_i64 (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:client_protocol_i64: ", p), err) } + } + return err } func (p *TOpenSessionReq) writeField1283(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetConnectionProperties() { - if err := oprot.WriteFieldBegin(ctx, "connectionProperties", thrift.MAP, 1283); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:connectionProperties: ", p), err) - } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.ConnectionProperties)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.ConnectionProperties { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:connectionProperties: ", p), err) - } - } - return err + if p.IsSetConnectionProperties() { + if err := oprot.WriteFieldBegin(ctx, "connectionProperties", thrift.MAP, 1283); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:connectionProperties: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.ConnectionProperties)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.ConnectionProperties { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:connectionProperties: ", p), err) } + } + return err } func (p *TOpenSessionReq) writeField1284(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetInitialNamespace() { - if err := oprot.WriteFieldBegin(ctx, "initialNamespace", thrift.STRUCT, 1284); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:initialNamespace: ", p), err) - } - if err := p.InitialNamespace.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InitialNamespace), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:initialNamespace: ", p), err) - } - } - return err + if p.IsSetInitialNamespace() { + if err := oprot.WriteFieldBegin(ctx, "initialNamespace", thrift.STRUCT, 1284); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:initialNamespace: ", p), err) } + if err := p.InitialNamespace.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InitialNamespace), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:initialNamespace: ", p), err) } + } + return err } func (p *TOpenSessionReq) writeField1285(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCanUseMultipleCatalogs() { - if err := oprot.WriteFieldBegin(ctx, "canUseMultipleCatalogs", thrift.BOOL, 1285); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:canUseMultipleCatalogs: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.CanUseMultipleCatalogs)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.canUseMultipleCatalogs (1285) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:canUseMultipleCatalogs: ", p), err) - } - } - return err + if p.IsSetCanUseMultipleCatalogs() { + if err := oprot.WriteFieldBegin(ctx, "canUseMultipleCatalogs", thrift.BOOL, 1285); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:canUseMultipleCatalogs: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.CanUseMultipleCatalogs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.canUseMultipleCatalogs (1285) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:canUseMultipleCatalogs: ", p), err) } + } + return err } func (p *TOpenSessionReq) Equals(other *TOpenSessionReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.ClientProtocol != other.ClientProtocol { - return false - } - if p.Username != other.Username { - if p.Username == nil || other.Username == nil { - return false - } - if (*p.Username) != (*other.Username) { - return false - } - } - if p.Password != other.Password { - if p.Password == nil || other.Password == nil { - return false - } - if (*p.Password) != (*other.Password) { - return false - } - } - if len(p.Configuration) != len(other.Configuration) { - return false - } - for k, _tgt := range p.Configuration { - _src49 := other.Configuration[k] - if _tgt != _src49 { - return false - } - } - if len(p.GetInfos) != len(other.GetInfos) { - return false - } - for i, _tgt := range p.GetInfos { - _src50 := other.GetInfos[i] - if _tgt != _src50 { - return false - } - } - if p.ClientProtocolI64 != other.ClientProtocolI64 { - if p.ClientProtocolI64 == nil || other.ClientProtocolI64 == nil { - return false - } - if (*p.ClientProtocolI64) != (*other.ClientProtocolI64) { - return false - } - } - if len(p.ConnectionProperties) != len(other.ConnectionProperties) { - return false - } - for k, _tgt := range p.ConnectionProperties { - _src51 := other.ConnectionProperties[k] - if _tgt != _src51 { - return false - } - } - if !p.InitialNamespace.Equals(other.InitialNamespace) { - return false - } - if p.CanUseMultipleCatalogs != other.CanUseMultipleCatalogs { - if p.CanUseMultipleCatalogs == nil || other.CanUseMultipleCatalogs == nil { - return false - } - if (*p.CanUseMultipleCatalogs) != (*other.CanUseMultipleCatalogs) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ClientProtocol != other.ClientProtocol { return false } + if p.Username != other.Username { + if p.Username == nil || other.Username == nil { + return false + } + if (*p.Username) != (*other.Username) { return false } + } + if p.Password != other.Password { + if p.Password == nil || other.Password == nil { + return false + } + if (*p.Password) != (*other.Password) { return false } + } + if len(p.Configuration) != len(other.Configuration) { return false } + for k, _tgt := range p.Configuration { + _src49 := other.Configuration[k] + if _tgt != _src49 { return false } + } + if len(p.GetInfos) != len(other.GetInfos) { return false } + for i, _tgt := range p.GetInfos { + _src50 := other.GetInfos[i] + if _tgt != _src50 { return false } + } + if p.ClientProtocolI64 != other.ClientProtocolI64 { + if p.ClientProtocolI64 == nil || other.ClientProtocolI64 == nil { + return false + } + if (*p.ClientProtocolI64) != (*other.ClientProtocolI64) { return false } + } + if len(p.ConnectionProperties) != len(other.ConnectionProperties) { return false } + for k, _tgt := range p.ConnectionProperties { + _src51 := other.ConnectionProperties[k] + if _tgt != _src51 { return false } + } + if !p.InitialNamespace.Equals(other.InitialNamespace) { return false } + if p.CanUseMultipleCatalogs != other.CanUseMultipleCatalogs { + if p.CanUseMultipleCatalogs == nil || other.CanUseMultipleCatalogs == nil { + return false + } + if (*p.CanUseMultipleCatalogs) != (*other.CanUseMultipleCatalogs) { return false } + } + return true } func (p *TOpenSessionReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TOpenSessionReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TOpenSessionReq(%+v)", *p) } func (p *TOpenSessionReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - ServerProtocolVersion -// - SessionHandle -// - Configuration -// - InitialNamespace -// - CanUseMultipleCatalogs -// - GetInfos +// - Status +// - ServerProtocolVersion +// - SessionHandle +// - Configuration +// - InitialNamespace +// - CanUseMultipleCatalogs +// - GetInfos type TOpenSessionResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - ServerProtocolVersion TProtocolVersion `thrift:"serverProtocolVersion,2,required" db:"serverProtocolVersion" json:"serverProtocolVersion"` - SessionHandle *TSessionHandle `thrift:"sessionHandle,3" db:"sessionHandle" json:"sessionHandle,omitempty"` - Configuration map[string]string `thrift:"configuration,4" db:"configuration" json:"configuration,omitempty"` - // unused fields # 5 to 1280 - GetInfos []*TGetInfoValue `thrift:"getInfos,1281" db:"getInfos" json:"getInfos,omitempty"` - // unused fields # 1282 to 1283 - InitialNamespace *TNamespace `thrift:"initialNamespace,1284" db:"initialNamespace" json:"initialNamespace,omitempty"` - CanUseMultipleCatalogs *bool `thrift:"canUseMultipleCatalogs,1285" db:"canUseMultipleCatalogs" json:"canUseMultipleCatalogs,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + ServerProtocolVersion TProtocolVersion `thrift:"serverProtocolVersion,2,required" db:"serverProtocolVersion" json:"serverProtocolVersion"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,3" db:"sessionHandle" json:"sessionHandle,omitempty"` + Configuration map[string]string `thrift:"configuration,4" db:"configuration" json:"configuration,omitempty"` + // unused fields # 5 to 1280 + GetInfos []*TGetInfoValue `thrift:"getInfos,1281" db:"getInfos" json:"getInfos,omitempty"` + // unused fields # 1282 to 1283 + InitialNamespace *TNamespace `thrift:"initialNamespace,1284" db:"initialNamespace" json:"initialNamespace,omitempty"` + CanUseMultipleCatalogs *bool `thrift:"canUseMultipleCatalogs,1285" db:"canUseMultipleCatalogs" json:"canUseMultipleCatalogs,omitempty"` } func NewTOpenSessionResp() *TOpenSessionResp { - return &TOpenSessionResp{} + return &TOpenSessionResp{} } var TOpenSessionResp_Status_DEFAULT *TStatus - func (p *TOpenSessionResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TOpenSessionResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TOpenSessionResp_Status_DEFAULT + } +return p.Status } func (p *TOpenSessionResp) GetServerProtocolVersion() TProtocolVersion { - return p.ServerProtocolVersion + return p.ServerProtocolVersion } - var TOpenSessionResp_SessionHandle_DEFAULT *TSessionHandle - func (p *TOpenSessionResp) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TOpenSessionResp_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TOpenSessionResp_SessionHandle_DEFAULT + } +return p.SessionHandle } - var TOpenSessionResp_Configuration_DEFAULT map[string]string func (p *TOpenSessionResp) GetConfiguration() map[string]string { - return p.Configuration + return p.Configuration } - var TOpenSessionResp_InitialNamespace_DEFAULT *TNamespace - func (p *TOpenSessionResp) GetInitialNamespace() *TNamespace { - if !p.IsSetInitialNamespace() { - return TOpenSessionResp_InitialNamespace_DEFAULT - } - return p.InitialNamespace + if !p.IsSetInitialNamespace() { + return TOpenSessionResp_InitialNamespace_DEFAULT + } +return p.InitialNamespace } - var TOpenSessionResp_CanUseMultipleCatalogs_DEFAULT bool - func (p *TOpenSessionResp) GetCanUseMultipleCatalogs() bool { - if !p.IsSetCanUseMultipleCatalogs() { - return TOpenSessionResp_CanUseMultipleCatalogs_DEFAULT - } - return *p.CanUseMultipleCatalogs + if !p.IsSetCanUseMultipleCatalogs() { + return TOpenSessionResp_CanUseMultipleCatalogs_DEFAULT + } +return *p.CanUseMultipleCatalogs } - var TOpenSessionResp_GetInfos_DEFAULT []*TGetInfoValue func (p *TOpenSessionResp) GetGetInfos() []*TGetInfoValue { - return p.GetInfos + return p.GetInfos } func (p *TOpenSessionResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TOpenSessionResp) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TOpenSessionResp) IsSetConfiguration() bool { - return p.Configuration != nil + return p.Configuration != nil } func (p *TOpenSessionResp) IsSetInitialNamespace() bool { - return p.InitialNamespace != nil + return p.InitialNamespace != nil } func (p *TOpenSessionResp) IsSetCanUseMultipleCatalogs() bool { - return p.CanUseMultipleCatalogs != nil + return p.CanUseMultipleCatalogs != nil } func (p *TOpenSessionResp) IsSetGetInfos() bool { - return p.GetInfos != nil + return p.GetInfos != nil } func (p *TOpenSessionResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - var issetServerProtocolVersion bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetServerProtocolVersion = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.MAP { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1284: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1284(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1285: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1285(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - if !issetServerProtocolVersion { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ServerProtocolVersion is not set")) - } - return nil -} - -func (p *TOpenSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TOpenSessionResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TProtocolVersion(v) - p.ServerProtocolVersion = temp - } - return nil -} - -func (p *TOpenSessionResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TOpenSessionResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]string, size) - p.Configuration = tMap - for i := 0; i < size; i++ { - var _key52 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key52 = v - } - var _val53 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _val53 = v - } - p.Configuration[_key52] = _val53 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TOpenSessionResp) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { - p.InitialNamespace = &TNamespace{} - if err := p.InitialNamespace.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InitialNamespace), err) - } - return nil -} - -func (p *TOpenSessionResp) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1285: ", err) - } else { - p.CanUseMultipleCatalogs = &v - } - return nil -} - -func (p *TOpenSessionResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TGetInfoValue, 0, size) - p.GetInfos = tSlice - for i := 0; i < size; i++ { - _elem54 := &TGetInfoValue{} - if err := _elem54.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem54), err) - } - p.GetInfos = append(p.GetInfos, _elem54) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + var issetServerProtocolVersion bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetServerProtocolVersion = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.MAP { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1284: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1284(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1285: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1285(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + if !issetServerProtocolVersion{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ServerProtocolVersion is not set")); + } + return nil +} + +func (p *TOpenSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TOpenSessionResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TProtocolVersion(v) + p.ServerProtocolVersion = temp +} + return nil +} + +func (p *TOpenSessionResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TOpenSessionResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.Configuration = tMap + for i := 0; i < size; i ++ { +var _key52 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key52 = v +} +var _val53 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val53 = v +} + p.Configuration[_key52] = _val53 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *TOpenSessionResp) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { + p.InitialNamespace = &TNamespace{} + if err := p.InitialNamespace.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InitialNamespace), err) + } + return nil +} + +func (p *TOpenSessionResp) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1285: ", err) +} else { + p.CanUseMultipleCatalogs = &v +} + return nil +} + +func (p *TOpenSessionResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TGetInfoValue, 0, size) + p.GetInfos = tSlice + for i := 0; i < size; i ++ { + _elem54 := &TGetInfoValue{} + if err := _elem54.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem54), err) + } + p.GetInfos = append(p.GetInfos, _elem54) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TOpenSessionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TOpenSessionResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1284(ctx, oprot); err != nil { - return err - } - if err := p.writeField1285(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TOpenSessionResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1284(ctx, oprot); err != nil { return err } + if err := p.writeField1285(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TOpenSessionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TOpenSessionResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "serverProtocolVersion", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:serverProtocolVersion: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(p.ServerProtocolVersion)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.serverProtocolVersion (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:serverProtocolVersion: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "serverProtocolVersion", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:serverProtocolVersion: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.ServerProtocolVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.serverProtocolVersion (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:serverProtocolVersion: ", p), err) } + return err } func (p *TOpenSessionResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSessionHandle() { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessionHandle: ", p), err) - } - } - return err + if p.IsSetSessionHandle() { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessionHandle: ", p), err) } + } + return err } func (p *TOpenSessionResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetConfiguration() { - if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) - } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.Configuration { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) - } - } - return err + if p.IsSetConfiguration() { + if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Configuration { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) } + } + return err } func (p *TOpenSessionResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetInfos() { - if err := oprot.WriteFieldBegin(ctx, "getInfos", thrift.LIST, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getInfos: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.GetInfos)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.GetInfos { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getInfos: ", p), err) - } - } - return err + if p.IsSetGetInfos() { + if err := oprot.WriteFieldBegin(ctx, "getInfos", thrift.LIST, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getInfos: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.GetInfos)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.GetInfos { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getInfos: ", p), err) } + } + return err } func (p *TOpenSessionResp) writeField1284(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetInitialNamespace() { - if err := oprot.WriteFieldBegin(ctx, "initialNamespace", thrift.STRUCT, 1284); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:initialNamespace: ", p), err) - } - if err := p.InitialNamespace.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InitialNamespace), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:initialNamespace: ", p), err) - } - } - return err + if p.IsSetInitialNamespace() { + if err := oprot.WriteFieldBegin(ctx, "initialNamespace", thrift.STRUCT, 1284); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:initialNamespace: ", p), err) } + if err := p.InitialNamespace.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InitialNamespace), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:initialNamespace: ", p), err) } + } + return err } func (p *TOpenSessionResp) writeField1285(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCanUseMultipleCatalogs() { - if err := oprot.WriteFieldBegin(ctx, "canUseMultipleCatalogs", thrift.BOOL, 1285); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:canUseMultipleCatalogs: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.CanUseMultipleCatalogs)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.canUseMultipleCatalogs (1285) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:canUseMultipleCatalogs: ", p), err) - } - } - return err + if p.IsSetCanUseMultipleCatalogs() { + if err := oprot.WriteFieldBegin(ctx, "canUseMultipleCatalogs", thrift.BOOL, 1285); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:canUseMultipleCatalogs: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.CanUseMultipleCatalogs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.canUseMultipleCatalogs (1285) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:canUseMultipleCatalogs: ", p), err) } + } + return err } func (p *TOpenSessionResp) Equals(other *TOpenSessionResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if p.ServerProtocolVersion != other.ServerProtocolVersion { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if len(p.Configuration) != len(other.Configuration) { - return false - } - for k, _tgt := range p.Configuration { - _src55 := other.Configuration[k] - if _tgt != _src55 { - return false - } - } - if len(p.GetInfos) != len(other.GetInfos) { - return false - } - for i, _tgt := range p.GetInfos { - _src56 := other.GetInfos[i] - if !_tgt.Equals(_src56) { - return false - } - } - if !p.InitialNamespace.Equals(other.InitialNamespace) { - return false - } - if p.CanUseMultipleCatalogs != other.CanUseMultipleCatalogs { - if p.CanUseMultipleCatalogs == nil || other.CanUseMultipleCatalogs == nil { - return false - } - if (*p.CanUseMultipleCatalogs) != (*other.CanUseMultipleCatalogs) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if p.ServerProtocolVersion != other.ServerProtocolVersion { return false } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if len(p.Configuration) != len(other.Configuration) { return false } + for k, _tgt := range p.Configuration { + _src55 := other.Configuration[k] + if _tgt != _src55 { return false } + } + if len(p.GetInfos) != len(other.GetInfos) { return false } + for i, _tgt := range p.GetInfos { + _src56 := other.GetInfos[i] + if !_tgt.Equals(_src56) { return false } + } + if !p.InitialNamespace.Equals(other.InitialNamespace) { return false } + if p.CanUseMultipleCatalogs != other.CanUseMultipleCatalogs { + if p.CanUseMultipleCatalogs == nil || other.CanUseMultipleCatalogs == nil { + return false + } + if (*p.CanUseMultipleCatalogs) != (*other.CanUseMultipleCatalogs) { return false } + } + return true } func (p *TOpenSessionResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TOpenSessionResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TOpenSessionResp(%+v)", *p) } func (p *TOpenSessionResp) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle +// - SessionHandle type TCloseSessionReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` } func NewTCloseSessionReq() *TCloseSessionReq { - return &TCloseSessionReq{} + return &TCloseSessionReq{} } var TCloseSessionReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TCloseSessionReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TCloseSessionReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TCloseSessionReq_SessionHandle_DEFAULT + } +return p.SessionHandle } func (p *TCloseSessionReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TCloseSessionReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - return nil -} - -func (p *TCloseSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + return nil +} + +func (p *TCloseSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil } func (p *TCloseSessionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCloseSessionReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TCloseSessionReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCloseSessionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TCloseSessionReq) Equals(other *TCloseSessionReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + return true } func (p *TCloseSessionReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCloseSessionReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCloseSessionReq(%+v)", *p) } func (p *TCloseSessionReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status +// - Status type TCloseSessionResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTCloseSessionResp() *TCloseSessionResp { - return &TCloseSessionResp{} + return &TCloseSessionResp{} } var TCloseSessionResp_Status_DEFAULT *TStatus - func (p *TCloseSessionResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCloseSessionResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TCloseSessionResp_Status_DEFAULT + } +return p.Status } func (p *TCloseSessionResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TCloseSessionResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TCloseSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TCloseSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil } func (p *TCloseSessionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCloseSessionResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TCloseSessionResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCloseSessionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TCloseSessionResp) Equals(other *TCloseSessionResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + return true } func (p *TCloseSessionResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCloseSessionResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCloseSessionResp(%+v)", *p) } func (p *TCloseSessionResp) Validate() error { - return nil + return nil } - // Attributes: -// - StringValue -// - SmallIntValue -// - IntegerBitmask -// - IntegerFlag -// - BinaryValue -// - LenValue +// - StringValue +// - SmallIntValue +// - IntegerBitmask +// - IntegerFlag +// - BinaryValue +// - LenValue type TGetInfoValue struct { - StringValue *string `thrift:"stringValue,1" db:"stringValue" json:"stringValue,omitempty"` - SmallIntValue *int16 `thrift:"smallIntValue,2" db:"smallIntValue" json:"smallIntValue,omitempty"` - IntegerBitmask *int32 `thrift:"integerBitmask,3" db:"integerBitmask" json:"integerBitmask,omitempty"` - IntegerFlag *int32 `thrift:"integerFlag,4" db:"integerFlag" json:"integerFlag,omitempty"` - BinaryValue *int32 `thrift:"binaryValue,5" db:"binaryValue" json:"binaryValue,omitempty"` - LenValue *int64 `thrift:"lenValue,6" db:"lenValue" json:"lenValue,omitempty"` + StringValue *string `thrift:"stringValue,1" db:"stringValue" json:"stringValue,omitempty"` + SmallIntValue *int16 `thrift:"smallIntValue,2" db:"smallIntValue" json:"smallIntValue,omitempty"` + IntegerBitmask *int32 `thrift:"integerBitmask,3" db:"integerBitmask" json:"integerBitmask,omitempty"` + IntegerFlag *int32 `thrift:"integerFlag,4" db:"integerFlag" json:"integerFlag,omitempty"` + BinaryValue *int32 `thrift:"binaryValue,5" db:"binaryValue" json:"binaryValue,omitempty"` + LenValue *int64 `thrift:"lenValue,6" db:"lenValue" json:"lenValue,omitempty"` } func NewTGetInfoValue() *TGetInfoValue { - return &TGetInfoValue{} + return &TGetInfoValue{} } var TGetInfoValue_StringValue_DEFAULT string - func (p *TGetInfoValue) GetStringValue() string { - if !p.IsSetStringValue() { - return TGetInfoValue_StringValue_DEFAULT - } - return *p.StringValue + if !p.IsSetStringValue() { + return TGetInfoValue_StringValue_DEFAULT + } +return *p.StringValue } - var TGetInfoValue_SmallIntValue_DEFAULT int16 - func (p *TGetInfoValue) GetSmallIntValue() int16 { - if !p.IsSetSmallIntValue() { - return TGetInfoValue_SmallIntValue_DEFAULT - } - return *p.SmallIntValue + if !p.IsSetSmallIntValue() { + return TGetInfoValue_SmallIntValue_DEFAULT + } +return *p.SmallIntValue } - var TGetInfoValue_IntegerBitmask_DEFAULT int32 - func (p *TGetInfoValue) GetIntegerBitmask() int32 { - if !p.IsSetIntegerBitmask() { - return TGetInfoValue_IntegerBitmask_DEFAULT - } - return *p.IntegerBitmask + if !p.IsSetIntegerBitmask() { + return TGetInfoValue_IntegerBitmask_DEFAULT + } +return *p.IntegerBitmask } - var TGetInfoValue_IntegerFlag_DEFAULT int32 - func (p *TGetInfoValue) GetIntegerFlag() int32 { - if !p.IsSetIntegerFlag() { - return TGetInfoValue_IntegerFlag_DEFAULT - } - return *p.IntegerFlag + if !p.IsSetIntegerFlag() { + return TGetInfoValue_IntegerFlag_DEFAULT + } +return *p.IntegerFlag } - var TGetInfoValue_BinaryValue_DEFAULT int32 - func (p *TGetInfoValue) GetBinaryValue() int32 { - if !p.IsSetBinaryValue() { - return TGetInfoValue_BinaryValue_DEFAULT - } - return *p.BinaryValue + if !p.IsSetBinaryValue() { + return TGetInfoValue_BinaryValue_DEFAULT + } +return *p.BinaryValue } - var TGetInfoValue_LenValue_DEFAULT int64 - func (p *TGetInfoValue) GetLenValue() int64 { - if !p.IsSetLenValue() { - return TGetInfoValue_LenValue_DEFAULT - } - return *p.LenValue + if !p.IsSetLenValue() { + return TGetInfoValue_LenValue_DEFAULT + } +return *p.LenValue } func (p *TGetInfoValue) CountSetFieldsTGetInfoValue() int { - count := 0 - if p.IsSetStringValue() { - count++ - } - if p.IsSetSmallIntValue() { - count++ - } - if p.IsSetIntegerBitmask() { - count++ - } - if p.IsSetIntegerFlag() { - count++ - } - if p.IsSetBinaryValue() { - count++ - } - if p.IsSetLenValue() { - count++ - } - return count + count := 0 + if (p.IsSetStringValue()) { + count++ + } + if (p.IsSetSmallIntValue()) { + count++ + } + if (p.IsSetIntegerBitmask()) { + count++ + } + if (p.IsSetIntegerFlag()) { + count++ + } + if (p.IsSetBinaryValue()) { + count++ + } + if (p.IsSetLenValue()) { + count++ + } + return count } func (p *TGetInfoValue) IsSetStringValue() bool { - return p.StringValue != nil + return p.StringValue != nil } func (p *TGetInfoValue) IsSetSmallIntValue() bool { - return p.SmallIntValue != nil + return p.SmallIntValue != nil } func (p *TGetInfoValue) IsSetIntegerBitmask() bool { - return p.IntegerBitmask != nil + return p.IntegerBitmask != nil } func (p *TGetInfoValue) IsSetIntegerFlag() bool { - return p.IntegerFlag != nil + return p.IntegerFlag != nil } func (p *TGetInfoValue) IsSetBinaryValue() bool { - return p.BinaryValue != nil + return p.BinaryValue != nil } func (p *TGetInfoValue) IsSetLenValue() bool { - return p.LenValue != nil + return p.LenValue != nil } func (p *TGetInfoValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I16 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I32 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I32 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.I32 { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.I64 { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TGetInfoValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.StringValue = &v - } - return nil -} - -func (p *TGetInfoValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.SmallIntValue = &v - } - return nil -} - -func (p *TGetInfoValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.IntegerBitmask = &v - } - return nil -} - -func (p *TGetInfoValue) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.IntegerFlag = &v - } - return nil -} - -func (p *TGetInfoValue) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - p.BinaryValue = &v - } - return nil -} - -func (p *TGetInfoValue) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) - } else { - p.LenValue = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I16 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TGetInfoValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.StringValue = &v +} + return nil +} + +func (p *TGetInfoValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.SmallIntValue = &v +} + return nil +} + +func (p *TGetInfoValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IntegerBitmask = &v +} + return nil +} + +func (p *TGetInfoValue) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IntegerFlag = &v +} + return nil +} + +func (p *TGetInfoValue) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.BinaryValue = &v +} + return nil +} + +func (p *TGetInfoValue) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.LenValue = &v +} + return nil } func (p *TGetInfoValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTGetInfoValue(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TGetInfoValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - if err := p.writeField6(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if c := p.CountSetFieldsTGetInfoValue(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TGetInfoValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetInfoValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringValue() { - if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:stringValue: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.stringValue (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:stringValue: ", p), err) - } - } - return err + if p.IsSetStringValue() { + if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:stringValue: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stringValue (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:stringValue: ", p), err) } + } + return err } func (p *TGetInfoValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSmallIntValue() { - if err := oprot.WriteFieldBegin(ctx, "smallIntValue", thrift.I16, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:smallIntValue: ", p), err) - } - if err := oprot.WriteI16(ctx, int16(*p.SmallIntValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.smallIntValue (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:smallIntValue: ", p), err) - } - } - return err + if p.IsSetSmallIntValue() { + if err := oprot.WriteFieldBegin(ctx, "smallIntValue", thrift.I16, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:smallIntValue: ", p), err) } + if err := oprot.WriteI16(ctx, int16(*p.SmallIntValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.smallIntValue (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:smallIntValue: ", p), err) } + } + return err } func (p *TGetInfoValue) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetIntegerBitmask() { - if err := oprot.WriteFieldBegin(ctx, "integerBitmask", thrift.I32, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:integerBitmask: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.IntegerBitmask)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.integerBitmask (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:integerBitmask: ", p), err) - } - } - return err + if p.IsSetIntegerBitmask() { + if err := oprot.WriteFieldBegin(ctx, "integerBitmask", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:integerBitmask: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.IntegerBitmask)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.integerBitmask (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:integerBitmask: ", p), err) } + } + return err } func (p *TGetInfoValue) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetIntegerFlag() { - if err := oprot.WriteFieldBegin(ctx, "integerFlag", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:integerFlag: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.IntegerFlag)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.integerFlag (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:integerFlag: ", p), err) - } - } - return err + if p.IsSetIntegerFlag() { + if err := oprot.WriteFieldBegin(ctx, "integerFlag", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:integerFlag: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.IntegerFlag)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.integerFlag (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:integerFlag: ", p), err) } + } + return err } func (p *TGetInfoValue) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBinaryValue() { - if err := oprot.WriteFieldBegin(ctx, "binaryValue", thrift.I32, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:binaryValue: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.BinaryValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.binaryValue (5) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:binaryValue: ", p), err) - } - } - return err + if p.IsSetBinaryValue() { + if err := oprot.WriteFieldBegin(ctx, "binaryValue", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:binaryValue: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.BinaryValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.binaryValue (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:binaryValue: ", p), err) } + } + return err } func (p *TGetInfoValue) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetLenValue() { - if err := oprot.WriteFieldBegin(ctx, "lenValue", thrift.I64, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:lenValue: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.LenValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.lenValue (6) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:lenValue: ", p), err) - } - } - return err + if p.IsSetLenValue() { + if err := oprot.WriteFieldBegin(ctx, "lenValue", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:lenValue: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.LenValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.lenValue (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:lenValue: ", p), err) } + } + return err } func (p *TGetInfoValue) Equals(other *TGetInfoValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.StringValue != other.StringValue { - if p.StringValue == nil || other.StringValue == nil { - return false - } - if (*p.StringValue) != (*other.StringValue) { - return false - } - } - if p.SmallIntValue != other.SmallIntValue { - if p.SmallIntValue == nil || other.SmallIntValue == nil { - return false - } - if (*p.SmallIntValue) != (*other.SmallIntValue) { - return false - } - } - if p.IntegerBitmask != other.IntegerBitmask { - if p.IntegerBitmask == nil || other.IntegerBitmask == nil { - return false - } - if (*p.IntegerBitmask) != (*other.IntegerBitmask) { - return false - } - } - if p.IntegerFlag != other.IntegerFlag { - if p.IntegerFlag == nil || other.IntegerFlag == nil { - return false - } - if (*p.IntegerFlag) != (*other.IntegerFlag) { - return false - } - } - if p.BinaryValue != other.BinaryValue { - if p.BinaryValue == nil || other.BinaryValue == nil { - return false - } - if (*p.BinaryValue) != (*other.BinaryValue) { - return false - } - } - if p.LenValue != other.LenValue { - if p.LenValue == nil || other.LenValue == nil { - return false - } - if (*p.LenValue) != (*other.LenValue) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StringValue != other.StringValue { + if p.StringValue == nil || other.StringValue == nil { + return false + } + if (*p.StringValue) != (*other.StringValue) { return false } + } + if p.SmallIntValue != other.SmallIntValue { + if p.SmallIntValue == nil || other.SmallIntValue == nil { + return false + } + if (*p.SmallIntValue) != (*other.SmallIntValue) { return false } + } + if p.IntegerBitmask != other.IntegerBitmask { + if p.IntegerBitmask == nil || other.IntegerBitmask == nil { + return false + } + if (*p.IntegerBitmask) != (*other.IntegerBitmask) { return false } + } + if p.IntegerFlag != other.IntegerFlag { + if p.IntegerFlag == nil || other.IntegerFlag == nil { + return false + } + if (*p.IntegerFlag) != (*other.IntegerFlag) { return false } + } + if p.BinaryValue != other.BinaryValue { + if p.BinaryValue == nil || other.BinaryValue == nil { + return false + } + if (*p.BinaryValue) != (*other.BinaryValue) { return false } + } + if p.LenValue != other.LenValue { + if p.LenValue == nil || other.LenValue == nil { + return false + } + if (*p.LenValue) != (*other.LenValue) { return false } + } + return true } func (p *TGetInfoValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetInfoValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetInfoValue(%+v)", *p) } func (p *TGetInfoValue) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - InfoType +// - SessionHandle +// - InfoType type TGetInfoReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - InfoType TGetInfoType `thrift:"infoType,2,required" db:"infoType" json:"infoType"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + InfoType TGetInfoType `thrift:"infoType,2,required" db:"infoType" json:"infoType"` } func NewTGetInfoReq() *TGetInfoReq { - return &TGetInfoReq{} + return &TGetInfoReq{} } var TGetInfoReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TGetInfoReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetInfoReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetInfoReq_SessionHandle_DEFAULT + } +return p.SessionHandle } func (p *TGetInfoReq) GetInfoType() TGetInfoType { - return p.InfoType + return p.InfoType } func (p *TGetInfoReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetInfoReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - var issetInfoType bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetInfoType = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - if !issetInfoType { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field InfoType is not set")) - } - return nil -} - -func (p *TGetInfoReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetInfoReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TGetInfoType(v) - p.InfoType = temp - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + var issetInfoType bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetInfoType = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + if !issetInfoType{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field InfoType is not set")); + } + return nil +} + +func (p *TGetInfoReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetInfoReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TGetInfoType(v) + p.InfoType = temp +} + return nil } func (p *TGetInfoReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetInfoReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetInfoReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TGetInfoReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "infoType", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoType: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(p.InfoType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.infoType (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoType: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "infoType", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoType: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.InfoType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.infoType (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoType: ", p), err) } + return err } func (p *TGetInfoReq) Equals(other *TGetInfoReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if p.InfoType != other.InfoType { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.InfoType != other.InfoType { return false } + return true } func (p *TGetInfoReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetInfoReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetInfoReq(%+v)", *p) } func (p *TGetInfoReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - InfoValue +// - Status +// - InfoValue type TGetInfoResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - InfoValue *TGetInfoValue `thrift:"infoValue,2,required" db:"infoValue" json:"infoValue"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + InfoValue *TGetInfoValue `thrift:"infoValue,2,required" db:"infoValue" json:"infoValue"` } func NewTGetInfoResp() *TGetInfoResp { - return &TGetInfoResp{} + return &TGetInfoResp{} } var TGetInfoResp_Status_DEFAULT *TStatus - func (p *TGetInfoResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetInfoResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TGetInfoResp_Status_DEFAULT + } +return p.Status } - var TGetInfoResp_InfoValue_DEFAULT *TGetInfoValue - func (p *TGetInfoResp) GetInfoValue() *TGetInfoValue { - if !p.IsSetInfoValue() { - return TGetInfoResp_InfoValue_DEFAULT - } - return p.InfoValue + if !p.IsSetInfoValue() { + return TGetInfoResp_InfoValue_DEFAULT + } +return p.InfoValue } func (p *TGetInfoResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetInfoResp) IsSetInfoValue() bool { - return p.InfoValue != nil + return p.InfoValue != nil } func (p *TGetInfoResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - var issetInfoValue bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetInfoValue = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - if !issetInfoValue { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field InfoValue is not set")) - } - return nil -} - -func (p *TGetInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.InfoValue = &TGetInfoValue{} - if err := p.InfoValue.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InfoValue), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + var issetInfoValue bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetInfoValue = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + if !issetInfoValue{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field InfoValue is not set")); + } + return nil +} + +func (p *TGetInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.InfoValue = &TGetInfoValue{} + if err := p.InfoValue.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InfoValue), err) + } + return nil } func (p *TGetInfoResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetInfoResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetInfoResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetInfoResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TGetInfoResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "infoValue", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoValue: ", p), err) - } - if err := p.InfoValue.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InfoValue), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoValue: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "infoValue", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoValue: ", p), err) } + if err := p.InfoValue.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InfoValue), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoValue: ", p), err) } + return err } func (p *TGetInfoResp) Equals(other *TGetInfoResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if !p.InfoValue.Equals(other.InfoValue) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.InfoValue.Equals(other.InfoValue) { return false } + return true } func (p *TGetInfoResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetInfoResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetInfoResp(%+v)", *p) } func (p *TGetInfoResp) Validate() error { - return nil + return nil } - // Attributes: -// - MaxRows -// - MaxBytes +// - MaxRows +// - MaxBytes type TSparkGetDirectResults struct { - MaxRows int64 `thrift:"maxRows,1,required" db:"maxRows" json:"maxRows"` - MaxBytes *int64 `thrift:"maxBytes,2" db:"maxBytes" json:"maxBytes,omitempty"` + MaxRows int64 `thrift:"maxRows,1,required" db:"maxRows" json:"maxRows"` + MaxBytes *int64 `thrift:"maxBytes,2" db:"maxBytes" json:"maxBytes,omitempty"` } func NewTSparkGetDirectResults() *TSparkGetDirectResults { - return &TSparkGetDirectResults{} + return &TSparkGetDirectResults{} } + func (p *TSparkGetDirectResults) GetMaxRows() int64 { - return p.MaxRows + return p.MaxRows } - var TSparkGetDirectResults_MaxBytes_DEFAULT int64 - func (p *TSparkGetDirectResults) GetMaxBytes() int64 { - if !p.IsSetMaxBytes() { - return TSparkGetDirectResults_MaxBytes_DEFAULT - } - return *p.MaxBytes + if !p.IsSetMaxBytes() { + return TSparkGetDirectResults_MaxBytes_DEFAULT + } +return *p.MaxBytes } func (p *TSparkGetDirectResults) IsSetMaxBytes() bool { - return p.MaxBytes != nil + return p.MaxBytes != nil } func (p *TSparkGetDirectResults) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetMaxRows bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetMaxRows = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I64 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetMaxRows { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxRows is not set")) - } - return nil -} - -func (p *TSparkGetDirectResults) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.MaxRows = v - } - return nil -} - -func (p *TSparkGetDirectResults) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.MaxBytes = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetMaxRows bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetMaxRows = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetMaxRows{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxRows is not set")); + } + return nil +} + +func (p *TSparkGetDirectResults) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.MaxRows = v +} + return nil +} + +func (p *TSparkGetDirectResults) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.MaxBytes = &v +} + return nil } func (p *TSparkGetDirectResults) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkGetDirectResults"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkGetDirectResults"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TSparkGetDirectResults) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "maxRows", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:maxRows: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(p.MaxRows)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxRows (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:maxRows: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "maxRows", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:maxRows: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.MaxRows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxRows (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:maxRows: ", p), err) } + return err } func (p *TSparkGetDirectResults) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetMaxBytes() { - if err := oprot.WriteFieldBegin(ctx, "maxBytes", thrift.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:maxBytes: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.MaxBytes)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxBytes (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:maxBytes: ", p), err) - } - } - return err + if p.IsSetMaxBytes() { + if err := oprot.WriteFieldBegin(ctx, "maxBytes", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:maxBytes: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.MaxBytes)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxBytes (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:maxBytes: ", p), err) } + } + return err } func (p *TSparkGetDirectResults) Equals(other *TSparkGetDirectResults) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.MaxRows != other.MaxRows { - return false - } - if p.MaxBytes != other.MaxBytes { - if p.MaxBytes == nil || other.MaxBytes == nil { - return false - } - if (*p.MaxBytes) != (*other.MaxBytes) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.MaxRows != other.MaxRows { return false } + if p.MaxBytes != other.MaxBytes { + if p.MaxBytes == nil || other.MaxBytes == nil { + return false + } + if (*p.MaxBytes) != (*other.MaxBytes) { return false } + } + return true } func (p *TSparkGetDirectResults) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkGetDirectResults(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkGetDirectResults(%+v)", *p) } func (p *TSparkGetDirectResults) Validate() error { - return nil + return nil } - // Attributes: -// - OperationStatus -// - ResultSetMetadata -// - ResultSet -// - CloseOperation +// - OperationStatus +// - ResultSetMetadata +// - ResultSet +// - CloseOperation type TSparkDirectResults struct { - OperationStatus *TGetOperationStatusResp `thrift:"operationStatus,1" db:"operationStatus" json:"operationStatus,omitempty"` - ResultSetMetadata *TGetResultSetMetadataResp `thrift:"resultSetMetadata,2" db:"resultSetMetadata" json:"resultSetMetadata,omitempty"` - ResultSet *TFetchResultsResp `thrift:"resultSet,3" db:"resultSet" json:"resultSet,omitempty"` - CloseOperation *TCloseOperationResp `thrift:"closeOperation,4" db:"closeOperation" json:"closeOperation,omitempty"` + OperationStatus *TGetOperationStatusResp `thrift:"operationStatus,1" db:"operationStatus" json:"operationStatus,omitempty"` + ResultSetMetadata *TGetResultSetMetadataResp `thrift:"resultSetMetadata,2" db:"resultSetMetadata" json:"resultSetMetadata,omitempty"` + ResultSet *TFetchResultsResp `thrift:"resultSet,3" db:"resultSet" json:"resultSet,omitempty"` + CloseOperation *TCloseOperationResp `thrift:"closeOperation,4" db:"closeOperation" json:"closeOperation,omitempty"` } func NewTSparkDirectResults() *TSparkDirectResults { - return &TSparkDirectResults{} + return &TSparkDirectResults{} } var TSparkDirectResults_OperationStatus_DEFAULT *TGetOperationStatusResp - func (p *TSparkDirectResults) GetOperationStatus() *TGetOperationStatusResp { - if !p.IsSetOperationStatus() { - return TSparkDirectResults_OperationStatus_DEFAULT - } - return p.OperationStatus + if !p.IsSetOperationStatus() { + return TSparkDirectResults_OperationStatus_DEFAULT + } +return p.OperationStatus } - var TSparkDirectResults_ResultSetMetadata_DEFAULT *TGetResultSetMetadataResp - func (p *TSparkDirectResults) GetResultSetMetadata() *TGetResultSetMetadataResp { - if !p.IsSetResultSetMetadata() { - return TSparkDirectResults_ResultSetMetadata_DEFAULT - } - return p.ResultSetMetadata + if !p.IsSetResultSetMetadata() { + return TSparkDirectResults_ResultSetMetadata_DEFAULT + } +return p.ResultSetMetadata } - var TSparkDirectResults_ResultSet_DEFAULT *TFetchResultsResp - func (p *TSparkDirectResults) GetResultSet() *TFetchResultsResp { - if !p.IsSetResultSet() { - return TSparkDirectResults_ResultSet_DEFAULT - } - return p.ResultSet + if !p.IsSetResultSet() { + return TSparkDirectResults_ResultSet_DEFAULT + } +return p.ResultSet } - var TSparkDirectResults_CloseOperation_DEFAULT *TCloseOperationResp - func (p *TSparkDirectResults) GetCloseOperation() *TCloseOperationResp { - if !p.IsSetCloseOperation() { - return TSparkDirectResults_CloseOperation_DEFAULT - } - return p.CloseOperation + if !p.IsSetCloseOperation() { + return TSparkDirectResults_CloseOperation_DEFAULT + } +return p.CloseOperation } func (p *TSparkDirectResults) IsSetOperationStatus() bool { - return p.OperationStatus != nil + return p.OperationStatus != nil } func (p *TSparkDirectResults) IsSetResultSetMetadata() bool { - return p.ResultSetMetadata != nil + return p.ResultSetMetadata != nil } func (p *TSparkDirectResults) IsSetResultSet() bool { - return p.ResultSet != nil + return p.ResultSet != nil } func (p *TSparkDirectResults) IsSetCloseOperation() bool { - return p.CloseOperation != nil + return p.CloseOperation != nil } func (p *TSparkDirectResults) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TSparkDirectResults) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationStatus = &TGetOperationStatusResp{} - if err := p.OperationStatus.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationStatus), err) - } - return nil -} - -func (p *TSparkDirectResults) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.ResultSetMetadata = &TGetResultSetMetadataResp{} - if err := p.ResultSetMetadata.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ResultSetMetadata), err) - } - return nil -} - -func (p *TSparkDirectResults) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.ResultSet = &TFetchResultsResp{} - if err := p.ResultSet.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ResultSet), err) - } - return nil -} - -func (p *TSparkDirectResults) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.CloseOperation = &TCloseOperationResp{} - if err := p.CloseOperation.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CloseOperation), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TSparkDirectResults) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationStatus = &TGetOperationStatusResp{} + if err := p.OperationStatus.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationStatus), err) + } + return nil +} + +func (p *TSparkDirectResults) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.ResultSetMetadata = &TGetResultSetMetadataResp{} + if err := p.ResultSetMetadata.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ResultSetMetadata), err) + } + return nil +} + +func (p *TSparkDirectResults) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.ResultSet = &TFetchResultsResp{} + if err := p.ResultSet.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ResultSet), err) + } + return nil +} + +func (p *TSparkDirectResults) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.CloseOperation = &TCloseOperationResp{} + if err := p.CloseOperation.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CloseOperation), err) + } + return nil } func (p *TSparkDirectResults) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkDirectResults"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkDirectResults"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TSparkDirectResults) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationStatus() { - if err := oprot.WriteFieldBegin(ctx, "operationStatus", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationStatus: ", p), err) - } - if err := p.OperationStatus.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationStatus), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationStatus: ", p), err) - } - } - return err + if p.IsSetOperationStatus() { + if err := oprot.WriteFieldBegin(ctx, "operationStatus", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationStatus: ", p), err) } + if err := p.OperationStatus.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationStatus), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationStatus: ", p), err) } + } + return err } func (p *TSparkDirectResults) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResultSetMetadata() { - if err := oprot.WriteFieldBegin(ctx, "resultSetMetadata", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:resultSetMetadata: ", p), err) - } - if err := p.ResultSetMetadata.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ResultSetMetadata), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:resultSetMetadata: ", p), err) - } - } - return err + if p.IsSetResultSetMetadata() { + if err := oprot.WriteFieldBegin(ctx, "resultSetMetadata", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:resultSetMetadata: ", p), err) } + if err := p.ResultSetMetadata.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ResultSetMetadata), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:resultSetMetadata: ", p), err) } + } + return err } func (p *TSparkDirectResults) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResultSet() { - if err := oprot.WriteFieldBegin(ctx, "resultSet", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:resultSet: ", p), err) - } - if err := p.ResultSet.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ResultSet), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:resultSet: ", p), err) - } - } - return err + if p.IsSetResultSet() { + if err := oprot.WriteFieldBegin(ctx, "resultSet", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:resultSet: ", p), err) } + if err := p.ResultSet.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ResultSet), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:resultSet: ", p), err) } + } + return err } func (p *TSparkDirectResults) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCloseOperation() { - if err := oprot.WriteFieldBegin(ctx, "closeOperation", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:closeOperation: ", p), err) - } - if err := p.CloseOperation.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CloseOperation), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:closeOperation: ", p), err) - } - } - return err + if p.IsSetCloseOperation() { + if err := oprot.WriteFieldBegin(ctx, "closeOperation", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:closeOperation: ", p), err) } + if err := p.CloseOperation.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CloseOperation), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:closeOperation: ", p), err) } + } + return err } func (p *TSparkDirectResults) Equals(other *TSparkDirectResults) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationStatus.Equals(other.OperationStatus) { - return false - } - if !p.ResultSetMetadata.Equals(other.ResultSetMetadata) { - return false - } - if !p.ResultSet.Equals(other.ResultSet) { - return false - } - if !p.CloseOperation.Equals(other.CloseOperation) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationStatus.Equals(other.OperationStatus) { return false } + if !p.ResultSetMetadata.Equals(other.ResultSetMetadata) { return false } + if !p.ResultSet.Equals(other.ResultSet) { return false } + if !p.CloseOperation.Equals(other.CloseOperation) { return false } + return true } func (p *TSparkDirectResults) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkDirectResults(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkDirectResults(%+v)", *p) } func (p *TSparkDirectResults) Validate() error { - return nil + return nil } - // Attributes: -// - TimestampAsArrow -// - DecimalAsArrow -// - ComplexTypesAsArrow -// - IntervalTypesAsArrow -// - NullTypeAsArrow +// - TimestampAsArrow +// - DecimalAsArrow +// - ComplexTypesAsArrow +// - IntervalTypesAsArrow +// - NullTypeAsArrow type TSparkArrowTypes struct { - TimestampAsArrow *bool `thrift:"timestampAsArrow,1" db:"timestampAsArrow" json:"timestampAsArrow,omitempty"` - DecimalAsArrow *bool `thrift:"decimalAsArrow,2" db:"decimalAsArrow" json:"decimalAsArrow,omitempty"` - ComplexTypesAsArrow *bool `thrift:"complexTypesAsArrow,3" db:"complexTypesAsArrow" json:"complexTypesAsArrow,omitempty"` - IntervalTypesAsArrow *bool `thrift:"intervalTypesAsArrow,4" db:"intervalTypesAsArrow" json:"intervalTypesAsArrow,omitempty"` - NullTypeAsArrow *bool `thrift:"nullTypeAsArrow,5" db:"nullTypeAsArrow" json:"nullTypeAsArrow,omitempty"` + TimestampAsArrow *bool `thrift:"timestampAsArrow,1" db:"timestampAsArrow" json:"timestampAsArrow,omitempty"` + DecimalAsArrow *bool `thrift:"decimalAsArrow,2" db:"decimalAsArrow" json:"decimalAsArrow,omitempty"` + ComplexTypesAsArrow *bool `thrift:"complexTypesAsArrow,3" db:"complexTypesAsArrow" json:"complexTypesAsArrow,omitempty"` + IntervalTypesAsArrow *bool `thrift:"intervalTypesAsArrow,4" db:"intervalTypesAsArrow" json:"intervalTypesAsArrow,omitempty"` + NullTypeAsArrow *bool `thrift:"nullTypeAsArrow,5" db:"nullTypeAsArrow" json:"nullTypeAsArrow,omitempty"` } func NewTSparkArrowTypes() *TSparkArrowTypes { - return &TSparkArrowTypes{} + return &TSparkArrowTypes{} } var TSparkArrowTypes_TimestampAsArrow_DEFAULT bool - func (p *TSparkArrowTypes) GetTimestampAsArrow() bool { - if !p.IsSetTimestampAsArrow() { - return TSparkArrowTypes_TimestampAsArrow_DEFAULT - } - return *p.TimestampAsArrow + if !p.IsSetTimestampAsArrow() { + return TSparkArrowTypes_TimestampAsArrow_DEFAULT + } +return *p.TimestampAsArrow } - var TSparkArrowTypes_DecimalAsArrow_DEFAULT bool - func (p *TSparkArrowTypes) GetDecimalAsArrow() bool { - if !p.IsSetDecimalAsArrow() { - return TSparkArrowTypes_DecimalAsArrow_DEFAULT - } - return *p.DecimalAsArrow + if !p.IsSetDecimalAsArrow() { + return TSparkArrowTypes_DecimalAsArrow_DEFAULT + } +return *p.DecimalAsArrow } - var TSparkArrowTypes_ComplexTypesAsArrow_DEFAULT bool - func (p *TSparkArrowTypes) GetComplexTypesAsArrow() bool { - if !p.IsSetComplexTypesAsArrow() { - return TSparkArrowTypes_ComplexTypesAsArrow_DEFAULT - } - return *p.ComplexTypesAsArrow + if !p.IsSetComplexTypesAsArrow() { + return TSparkArrowTypes_ComplexTypesAsArrow_DEFAULT + } +return *p.ComplexTypesAsArrow } - var TSparkArrowTypes_IntervalTypesAsArrow_DEFAULT bool - func (p *TSparkArrowTypes) GetIntervalTypesAsArrow() bool { - if !p.IsSetIntervalTypesAsArrow() { - return TSparkArrowTypes_IntervalTypesAsArrow_DEFAULT - } - return *p.IntervalTypesAsArrow + if !p.IsSetIntervalTypesAsArrow() { + return TSparkArrowTypes_IntervalTypesAsArrow_DEFAULT + } +return *p.IntervalTypesAsArrow } - var TSparkArrowTypes_NullTypeAsArrow_DEFAULT bool - func (p *TSparkArrowTypes) GetNullTypeAsArrow() bool { - if !p.IsSetNullTypeAsArrow() { - return TSparkArrowTypes_NullTypeAsArrow_DEFAULT - } - return *p.NullTypeAsArrow + if !p.IsSetNullTypeAsArrow() { + return TSparkArrowTypes_NullTypeAsArrow_DEFAULT + } +return *p.NullTypeAsArrow } func (p *TSparkArrowTypes) IsSetTimestampAsArrow() bool { - return p.TimestampAsArrow != nil + return p.TimestampAsArrow != nil } func (p *TSparkArrowTypes) IsSetDecimalAsArrow() bool { - return p.DecimalAsArrow != nil + return p.DecimalAsArrow != nil } func (p *TSparkArrowTypes) IsSetComplexTypesAsArrow() bool { - return p.ComplexTypesAsArrow != nil + return p.ComplexTypesAsArrow != nil } func (p *TSparkArrowTypes) IsSetIntervalTypesAsArrow() bool { - return p.IntervalTypesAsArrow != nil + return p.IntervalTypesAsArrow != nil } func (p *TSparkArrowTypes) IsSetNullTypeAsArrow() bool { - return p.NullTypeAsArrow != nil + return p.NullTypeAsArrow != nil } func (p *TSparkArrowTypes) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TSparkArrowTypes) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.TimestampAsArrow = &v - } - return nil -} - -func (p *TSparkArrowTypes) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.DecimalAsArrow = &v - } - return nil -} - -func (p *TSparkArrowTypes) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.ComplexTypesAsArrow = &v - } - return nil -} - -func (p *TSparkArrowTypes) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.IntervalTypesAsArrow = &v - } - return nil -} - -func (p *TSparkArrowTypes) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - p.NullTypeAsArrow = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TSparkArrowTypes) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.TimestampAsArrow = &v +} + return nil +} + +func (p *TSparkArrowTypes) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.DecimalAsArrow = &v +} + return nil +} + +func (p *TSparkArrowTypes) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ComplexTypesAsArrow = &v +} + return nil +} + +func (p *TSparkArrowTypes) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IntervalTypesAsArrow = &v +} + return nil +} + +func (p *TSparkArrowTypes) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.NullTypeAsArrow = &v +} + return nil } func (p *TSparkArrowTypes) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkArrowTypes"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkArrowTypes"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TSparkArrowTypes) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTimestampAsArrow() { - if err := oprot.WriteFieldBegin(ctx, "timestampAsArrow", thrift.BOOL, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:timestampAsArrow: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.TimestampAsArrow)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.timestampAsArrow (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:timestampAsArrow: ", p), err) - } - } - return err + if p.IsSetTimestampAsArrow() { + if err := oprot.WriteFieldBegin(ctx, "timestampAsArrow", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:timestampAsArrow: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.TimestampAsArrow)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timestampAsArrow (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:timestampAsArrow: ", p), err) } + } + return err } func (p *TSparkArrowTypes) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDecimalAsArrow() { - if err := oprot.WriteFieldBegin(ctx, "decimalAsArrow", thrift.BOOL, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:decimalAsArrow: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.DecimalAsArrow)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.decimalAsArrow (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:decimalAsArrow: ", p), err) - } - } - return err + if p.IsSetDecimalAsArrow() { + if err := oprot.WriteFieldBegin(ctx, "decimalAsArrow", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:decimalAsArrow: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.DecimalAsArrow)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.decimalAsArrow (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:decimalAsArrow: ", p), err) } + } + return err } func (p *TSparkArrowTypes) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetComplexTypesAsArrow() { - if err := oprot.WriteFieldBegin(ctx, "complexTypesAsArrow", thrift.BOOL, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:complexTypesAsArrow: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.ComplexTypesAsArrow)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.complexTypesAsArrow (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:complexTypesAsArrow: ", p), err) - } - } - return err + if p.IsSetComplexTypesAsArrow() { + if err := oprot.WriteFieldBegin(ctx, "complexTypesAsArrow", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:complexTypesAsArrow: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.ComplexTypesAsArrow)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.complexTypesAsArrow (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:complexTypesAsArrow: ", p), err) } + } + return err } func (p *TSparkArrowTypes) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetIntervalTypesAsArrow() { - if err := oprot.WriteFieldBegin(ctx, "intervalTypesAsArrow", thrift.BOOL, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:intervalTypesAsArrow: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.IntervalTypesAsArrow)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.intervalTypesAsArrow (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:intervalTypesAsArrow: ", p), err) - } - } - return err + if p.IsSetIntervalTypesAsArrow() { + if err := oprot.WriteFieldBegin(ctx, "intervalTypesAsArrow", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:intervalTypesAsArrow: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.IntervalTypesAsArrow)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.intervalTypesAsArrow (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:intervalTypesAsArrow: ", p), err) } + } + return err } func (p *TSparkArrowTypes) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetNullTypeAsArrow() { - if err := oprot.WriteFieldBegin(ctx, "nullTypeAsArrow", thrift.BOOL, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:nullTypeAsArrow: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.NullTypeAsArrow)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.nullTypeAsArrow (5) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:nullTypeAsArrow: ", p), err) - } - } - return err + if p.IsSetNullTypeAsArrow() { + if err := oprot.WriteFieldBegin(ctx, "nullTypeAsArrow", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:nullTypeAsArrow: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.NullTypeAsArrow)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nullTypeAsArrow (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:nullTypeAsArrow: ", p), err) } + } + return err } func (p *TSparkArrowTypes) Equals(other *TSparkArrowTypes) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.TimestampAsArrow != other.TimestampAsArrow { - if p.TimestampAsArrow == nil || other.TimestampAsArrow == nil { - return false - } - if (*p.TimestampAsArrow) != (*other.TimestampAsArrow) { - return false - } - } - if p.DecimalAsArrow != other.DecimalAsArrow { - if p.DecimalAsArrow == nil || other.DecimalAsArrow == nil { - return false - } - if (*p.DecimalAsArrow) != (*other.DecimalAsArrow) { - return false - } - } - if p.ComplexTypesAsArrow != other.ComplexTypesAsArrow { - if p.ComplexTypesAsArrow == nil || other.ComplexTypesAsArrow == nil { - return false - } - if (*p.ComplexTypesAsArrow) != (*other.ComplexTypesAsArrow) { - return false - } - } - if p.IntervalTypesAsArrow != other.IntervalTypesAsArrow { - if p.IntervalTypesAsArrow == nil || other.IntervalTypesAsArrow == nil { - return false - } - if (*p.IntervalTypesAsArrow) != (*other.IntervalTypesAsArrow) { - return false - } - } - if p.NullTypeAsArrow != other.NullTypeAsArrow { - if p.NullTypeAsArrow == nil || other.NullTypeAsArrow == nil { - return false - } - if (*p.NullTypeAsArrow) != (*other.NullTypeAsArrow) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.TimestampAsArrow != other.TimestampAsArrow { + if p.TimestampAsArrow == nil || other.TimestampAsArrow == nil { + return false + } + if (*p.TimestampAsArrow) != (*other.TimestampAsArrow) { return false } + } + if p.DecimalAsArrow != other.DecimalAsArrow { + if p.DecimalAsArrow == nil || other.DecimalAsArrow == nil { + return false + } + if (*p.DecimalAsArrow) != (*other.DecimalAsArrow) { return false } + } + if p.ComplexTypesAsArrow != other.ComplexTypesAsArrow { + if p.ComplexTypesAsArrow == nil || other.ComplexTypesAsArrow == nil { + return false + } + if (*p.ComplexTypesAsArrow) != (*other.ComplexTypesAsArrow) { return false } + } + if p.IntervalTypesAsArrow != other.IntervalTypesAsArrow { + if p.IntervalTypesAsArrow == nil || other.IntervalTypesAsArrow == nil { + return false + } + if (*p.IntervalTypesAsArrow) != (*other.IntervalTypesAsArrow) { return false } + } + if p.NullTypeAsArrow != other.NullTypeAsArrow { + if p.NullTypeAsArrow == nil || other.NullTypeAsArrow == nil { + return false + } + if (*p.NullTypeAsArrow) != (*other.NullTypeAsArrow) { return false } + } + return true } func (p *TSparkArrowTypes) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkArrowTypes(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkArrowTypes(%+v)", *p) } func (p *TSparkArrowTypes) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - Statement -// - ConfOverlay -// - RunAsync -// - GetDirectResults -// - QueryTimeout -// - CanReadArrowResult_ -// - CanDownloadResult_ -// - CanDecompressLZ4Result_ -// - MaxBytesPerFile -// - UseArrowNativeTypes -// - ResultRowLimit -// - Parameters -// - MaxBytesPerBatch -// - StatementConf +// - SessionHandle +// - Statement +// - ConfOverlay +// - RunAsync +// - GetDirectResults +// - QueryTimeout +// - CanReadArrowResult_ +// - CanDownloadResult_ +// - CanDecompressLZ4Result_ +// - MaxBytesPerFile +// - UseArrowNativeTypes +// - ResultRowLimit +// - Parameters +// - MaxBytesPerBatch +// - StatementConf type TExecuteStatementReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - Statement string `thrift:"statement,2,required" db:"statement" json:"statement"` - ConfOverlay map[string]string `thrift:"confOverlay,3" db:"confOverlay" json:"confOverlay,omitempty"` - RunAsync bool `thrift:"runAsync,4" db:"runAsync" json:"runAsync"` - QueryTimeout int64 `thrift:"queryTimeout,5" db:"queryTimeout" json:"queryTimeout"` - // unused fields # 6 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - CanReadArrowResult_ *bool `thrift:"canReadArrowResult,1282" db:"canReadArrowResult" json:"canReadArrowResult,omitempty"` - CanDownloadResult_ *bool `thrift:"canDownloadResult,1283" db:"canDownloadResult" json:"canDownloadResult,omitempty"` - CanDecompressLZ4Result_ *bool `thrift:"canDecompressLZ4Result,1284" db:"canDecompressLZ4Result" json:"canDecompressLZ4Result,omitempty"` - MaxBytesPerFile *int64 `thrift:"maxBytesPerFile,1285" db:"maxBytesPerFile" json:"maxBytesPerFile,omitempty"` - UseArrowNativeTypes *TSparkArrowTypes `thrift:"useArrowNativeTypes,1286" db:"useArrowNativeTypes" json:"useArrowNativeTypes,omitempty"` - ResultRowLimit *int64 `thrift:"resultRowLimit,1287" db:"resultRowLimit" json:"resultRowLimit,omitempty"` - Parameters []*TSparkParameter `thrift:"parameters,1288" db:"parameters" json:"parameters,omitempty"` - MaxBytesPerBatch *int64 `thrift:"maxBytesPerBatch,1289" db:"maxBytesPerBatch" json:"maxBytesPerBatch,omitempty"` - // unused fields # 1290 to 1295 - StatementConf *TStatementConf `thrift:"statementConf,1296" db:"statementConf" json:"statementConf,omitempty"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + Statement string `thrift:"statement,2,required" db:"statement" json:"statement"` + ConfOverlay map[string]string `thrift:"confOverlay,3" db:"confOverlay" json:"confOverlay,omitempty"` + RunAsync bool `thrift:"runAsync,4" db:"runAsync" json:"runAsync"` + QueryTimeout int64 `thrift:"queryTimeout,5" db:"queryTimeout" json:"queryTimeout"` + // unused fields # 6 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + CanReadArrowResult_ *bool `thrift:"canReadArrowResult,1282" db:"canReadArrowResult" json:"canReadArrowResult,omitempty"` + CanDownloadResult_ *bool `thrift:"canDownloadResult,1283" db:"canDownloadResult" json:"canDownloadResult,omitempty"` + CanDecompressLZ4Result_ *bool `thrift:"canDecompressLZ4Result,1284" db:"canDecompressLZ4Result" json:"canDecompressLZ4Result,omitempty"` + MaxBytesPerFile *int64 `thrift:"maxBytesPerFile,1285" db:"maxBytesPerFile" json:"maxBytesPerFile,omitempty"` + UseArrowNativeTypes *TSparkArrowTypes `thrift:"useArrowNativeTypes,1286" db:"useArrowNativeTypes" json:"useArrowNativeTypes,omitempty"` + ResultRowLimit *int64 `thrift:"resultRowLimit,1287" db:"resultRowLimit" json:"resultRowLimit,omitempty"` + Parameters []*TSparkParameter `thrift:"parameters,1288" db:"parameters" json:"parameters,omitempty"` + MaxBytesPerBatch *int64 `thrift:"maxBytesPerBatch,1289" db:"maxBytesPerBatch" json:"maxBytesPerBatch,omitempty"` + // unused fields # 1290 to 1295 + StatementConf *TStatementConf `thrift:"statementConf,1296" db:"statementConf" json:"statementConf,omitempty"` } func NewTExecuteStatementReq() *TExecuteStatementReq { - return &TExecuteStatementReq{} + return &TExecuteStatementReq{} } var TExecuteStatementReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TExecuteStatementReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TExecuteStatementReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TExecuteStatementReq_SessionHandle_DEFAULT + } +return p.SessionHandle } func (p *TExecuteStatementReq) GetStatement() string { - return p.Statement + return p.Statement } - var TExecuteStatementReq_ConfOverlay_DEFAULT map[string]string func (p *TExecuteStatementReq) GetConfOverlay() map[string]string { - return p.ConfOverlay + return p.ConfOverlay } - var TExecuteStatementReq_RunAsync_DEFAULT bool = false func (p *TExecuteStatementReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } - var TExecuteStatementReq_GetDirectResults_DEFAULT *TSparkGetDirectResults - func (p *TExecuteStatementReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TExecuteStatementReq_GetDirectResults_DEFAULT - } - return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TExecuteStatementReq_GetDirectResults_DEFAULT + } +return p.GetDirectResults } - var TExecuteStatementReq_QueryTimeout_DEFAULT int64 = 0 func (p *TExecuteStatementReq) GetQueryTimeout() int64 { - return p.QueryTimeout + return p.QueryTimeout } - var TExecuteStatementReq_CanReadArrowResult__DEFAULT bool - func (p *TExecuteStatementReq) GetCanReadArrowResult_() bool { - if !p.IsSetCanReadArrowResult_() { - return TExecuteStatementReq_CanReadArrowResult__DEFAULT - } - return *p.CanReadArrowResult_ + if !p.IsSetCanReadArrowResult_() { + return TExecuteStatementReq_CanReadArrowResult__DEFAULT + } +return *p.CanReadArrowResult_ } - var TExecuteStatementReq_CanDownloadResult__DEFAULT bool - func (p *TExecuteStatementReq) GetCanDownloadResult_() bool { - if !p.IsSetCanDownloadResult_() { - return TExecuteStatementReq_CanDownloadResult__DEFAULT - } - return *p.CanDownloadResult_ + if !p.IsSetCanDownloadResult_() { + return TExecuteStatementReq_CanDownloadResult__DEFAULT + } +return *p.CanDownloadResult_ } - var TExecuteStatementReq_CanDecompressLZ4Result__DEFAULT bool - func (p *TExecuteStatementReq) GetCanDecompressLZ4Result_() bool { - if !p.IsSetCanDecompressLZ4Result_() { - return TExecuteStatementReq_CanDecompressLZ4Result__DEFAULT - } - return *p.CanDecompressLZ4Result_ + if !p.IsSetCanDecompressLZ4Result_() { + return TExecuteStatementReq_CanDecompressLZ4Result__DEFAULT + } +return *p.CanDecompressLZ4Result_ } - var TExecuteStatementReq_MaxBytesPerFile_DEFAULT int64 - func (p *TExecuteStatementReq) GetMaxBytesPerFile() int64 { - if !p.IsSetMaxBytesPerFile() { - return TExecuteStatementReq_MaxBytesPerFile_DEFAULT - } - return *p.MaxBytesPerFile + if !p.IsSetMaxBytesPerFile() { + return TExecuteStatementReq_MaxBytesPerFile_DEFAULT + } +return *p.MaxBytesPerFile } - var TExecuteStatementReq_UseArrowNativeTypes_DEFAULT *TSparkArrowTypes - func (p *TExecuteStatementReq) GetUseArrowNativeTypes() *TSparkArrowTypes { - if !p.IsSetUseArrowNativeTypes() { - return TExecuteStatementReq_UseArrowNativeTypes_DEFAULT - } - return p.UseArrowNativeTypes + if !p.IsSetUseArrowNativeTypes() { + return TExecuteStatementReq_UseArrowNativeTypes_DEFAULT + } +return p.UseArrowNativeTypes } - var TExecuteStatementReq_ResultRowLimit_DEFAULT int64 - func (p *TExecuteStatementReq) GetResultRowLimit() int64 { - if !p.IsSetResultRowLimit() { - return TExecuteStatementReq_ResultRowLimit_DEFAULT - } - return *p.ResultRowLimit + if !p.IsSetResultRowLimit() { + return TExecuteStatementReq_ResultRowLimit_DEFAULT + } +return *p.ResultRowLimit } - var TExecuteStatementReq_Parameters_DEFAULT []*TSparkParameter func (p *TExecuteStatementReq) GetParameters() []*TSparkParameter { - return p.Parameters + return p.Parameters } - var TExecuteStatementReq_MaxBytesPerBatch_DEFAULT int64 - func (p *TExecuteStatementReq) GetMaxBytesPerBatch() int64 { - if !p.IsSetMaxBytesPerBatch() { - return TExecuteStatementReq_MaxBytesPerBatch_DEFAULT - } - return *p.MaxBytesPerBatch + if !p.IsSetMaxBytesPerBatch() { + return TExecuteStatementReq_MaxBytesPerBatch_DEFAULT + } +return *p.MaxBytesPerBatch } - var TExecuteStatementReq_StatementConf_DEFAULT *TStatementConf - func (p *TExecuteStatementReq) GetStatementConf() *TStatementConf { - if !p.IsSetStatementConf() { - return TExecuteStatementReq_StatementConf_DEFAULT - } - return p.StatementConf + if !p.IsSetStatementConf() { + return TExecuteStatementReq_StatementConf_DEFAULT + } +return p.StatementConf } func (p *TExecuteStatementReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TExecuteStatementReq) IsSetConfOverlay() bool { - return p.ConfOverlay != nil + return p.ConfOverlay != nil } func (p *TExecuteStatementReq) IsSetRunAsync() bool { - return p.RunAsync != TExecuteStatementReq_RunAsync_DEFAULT + return p.RunAsync != TExecuteStatementReq_RunAsync_DEFAULT } func (p *TExecuteStatementReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TExecuteStatementReq) IsSetQueryTimeout() bool { - return p.QueryTimeout != TExecuteStatementReq_QueryTimeout_DEFAULT + return p.QueryTimeout != TExecuteStatementReq_QueryTimeout_DEFAULT } func (p *TExecuteStatementReq) IsSetCanReadArrowResult_() bool { - return p.CanReadArrowResult_ != nil + return p.CanReadArrowResult_ != nil } func (p *TExecuteStatementReq) IsSetCanDownloadResult_() bool { - return p.CanDownloadResult_ != nil + return p.CanDownloadResult_ != nil } func (p *TExecuteStatementReq) IsSetCanDecompressLZ4Result_() bool { - return p.CanDecompressLZ4Result_ != nil + return p.CanDecompressLZ4Result_ != nil } func (p *TExecuteStatementReq) IsSetMaxBytesPerFile() bool { - return p.MaxBytesPerFile != nil + return p.MaxBytesPerFile != nil } func (p *TExecuteStatementReq) IsSetUseArrowNativeTypes() bool { - return p.UseArrowNativeTypes != nil + return p.UseArrowNativeTypes != nil } func (p *TExecuteStatementReq) IsSetResultRowLimit() bool { - return p.ResultRowLimit != nil + return p.ResultRowLimit != nil } func (p *TExecuteStatementReq) IsSetParameters() bool { - return p.Parameters != nil + return p.Parameters != nil } func (p *TExecuteStatementReq) IsSetMaxBytesPerBatch() bool { - return p.MaxBytesPerBatch != nil + return p.MaxBytesPerBatch != nil } func (p *TExecuteStatementReq) IsSetStatementConf() bool { - return p.StatementConf != nil + return p.StatementConf != nil } func (p *TExecuteStatementReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - var issetStatement bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetStatement = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.MAP { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.I64 { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1283: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1283(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1284: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1284(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1285: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1285(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1286: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1286(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1287: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1287(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1288: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1288(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1289: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1289(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1296: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1296(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - if !issetStatement { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Statement is not set")) - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TExecuteStatementReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Statement = v - } - return nil -} - -func (p *TExecuteStatementReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin(ctx) - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]string, size) - p.ConfOverlay = tMap - for i := 0; i < size; i++ { - var _key57 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key57 = v - } - var _val58 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _val58 = v - } - p.ConfOverlay[_key57] = _val58 - } - if err := iprot.ReadMapEnd(ctx); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *TExecuteStatementReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.RunAsync = v - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TExecuteStatementReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - p.QueryTimeout = v - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.CanReadArrowResult_ = &v - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1283: ", err) - } else { - p.CanDownloadResult_ = &v - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1284: ", err) - } else { - p.CanDecompressLZ4Result_ = &v - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1285: ", err) - } else { - p.MaxBytesPerFile = &v - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1286(ctx context.Context, iprot thrift.TProtocol) error { - p.UseArrowNativeTypes = &TSparkArrowTypes{} - if err := p.UseArrowNativeTypes.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UseArrowNativeTypes), err) - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1287(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1287: ", err) - } else { - p.ResultRowLimit = &v - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1288(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TSparkParameter, 0, size) - p.Parameters = tSlice - for i := 0; i < size; i++ { - _elem59 := &TSparkParameter{} - if err := _elem59.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err) - } - p.Parameters = append(p.Parameters, _elem59) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1289(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1289: ", err) - } else { - p.MaxBytesPerBatch = &v - } - return nil -} - -func (p *TExecuteStatementReq) ReadField1296(ctx context.Context, iprot thrift.TProtocol) error { - p.StatementConf = &TStatementConf{} - if err := p.StatementConf.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StatementConf), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + var issetStatement bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetStatement = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1283: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1283(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1284: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1284(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1285: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1285(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1286: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1286(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1287: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1287(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1288: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1288(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1289: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1289(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1296: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1296(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + if !issetStatement{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Statement is not set")); + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TExecuteStatementReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Statement = v +} + return nil +} + +func (p *TExecuteStatementReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.ConfOverlay = tMap + for i := 0; i < size; i ++ { +var _key57 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key57 = v +} +var _val58 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val58 = v +} + p.ConfOverlay[_key57] = _val58 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *TExecuteStatementReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.RunAsync = v +} + return nil +} + +func (p *TExecuteStatementReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TExecuteStatementReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.QueryTimeout = v +} + return nil +} + +func (p *TExecuteStatementReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.CanReadArrowResult_ = &v +} + return nil +} + +func (p *TExecuteStatementReq) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1283: ", err) +} else { + p.CanDownloadResult_ = &v +} + return nil +} + +func (p *TExecuteStatementReq) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1284: ", err) +} else { + p.CanDecompressLZ4Result_ = &v +} + return nil +} + +func (p *TExecuteStatementReq) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1285: ", err) +} else { + p.MaxBytesPerFile = &v +} + return nil +} + +func (p *TExecuteStatementReq) ReadField1286(ctx context.Context, iprot thrift.TProtocol) error { + p.UseArrowNativeTypes = &TSparkArrowTypes{} + if err := p.UseArrowNativeTypes.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UseArrowNativeTypes), err) + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1287(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1287: ", err) +} else { + p.ResultRowLimit = &v +} + return nil +} + +func (p *TExecuteStatementReq) ReadField1288(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TSparkParameter, 0, size) + p.Parameters = tSlice + for i := 0; i < size; i ++ { + _elem59 := &TSparkParameter{} + if err := _elem59.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err) + } + p.Parameters = append(p.Parameters, _elem59) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TExecuteStatementReq) ReadField1289(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1289: ", err) +} else { + p.MaxBytesPerBatch = &v +} + return nil +} + +func (p *TExecuteStatementReq) ReadField1296(ctx context.Context, iprot thrift.TProtocol) error { + p.StatementConf = &TStatementConf{} + if err := p.StatementConf.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StatementConf), err) + } + return nil } func (p *TExecuteStatementReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TExecuteStatementReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - if err := p.writeField1283(ctx, oprot); err != nil { - return err - } - if err := p.writeField1284(ctx, oprot); err != nil { - return err - } - if err := p.writeField1285(ctx, oprot); err != nil { - return err - } - if err := p.writeField1286(ctx, oprot); err != nil { - return err - } - if err := p.writeField1287(ctx, oprot); err != nil { - return err - } - if err := p.writeField1288(ctx, oprot); err != nil { - return err - } - if err := p.writeField1289(ctx, oprot); err != nil { - return err - } - if err := p.writeField1296(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TExecuteStatementReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + if err := p.writeField1283(ctx, oprot); err != nil { return err } + if err := p.writeField1284(ctx, oprot); err != nil { return err } + if err := p.writeField1285(ctx, oprot); err != nil { return err } + if err := p.writeField1286(ctx, oprot); err != nil { return err } + if err := p.writeField1287(ctx, oprot); err != nil { return err } + if err := p.writeField1288(ctx, oprot); err != nil { return err } + if err := p.writeField1289(ctx, oprot); err != nil { return err } + if err := p.writeField1296(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TExecuteStatementReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TExecuteStatementReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "statement", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statement: ", p), err) - } - if err := oprot.WriteString(ctx, string(p.Statement)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.statement (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statement: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "statement", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statement: ", p), err) } + if err := oprot.WriteString(ctx, string(p.Statement)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.statement (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statement: ", p), err) } + return err } func (p *TExecuteStatementReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetConfOverlay() { - if err := oprot.WriteFieldBegin(ctx, "confOverlay", thrift.MAP, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:confOverlay: ", p), err) - } - if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.ConfOverlay)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.ConfOverlay { - if err := oprot.WriteString(ctx, string(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteMapEnd(ctx); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:confOverlay: ", p), err) - } - } - return err + if p.IsSetConfOverlay() { + if err := oprot.WriteFieldBegin(ctx, "confOverlay", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:confOverlay: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.ConfOverlay)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.ConfOverlay { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:confOverlay: ", p), err) } + } + return err } func (p *TExecuteStatementReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:runAsync: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:runAsync: ", p), err) - } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:runAsync: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:runAsync: ", p), err) } + } + return err } func (p *TExecuteStatementReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetQueryTimeout() { - if err := oprot.WriteFieldBegin(ctx, "queryTimeout", thrift.I64, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:queryTimeout: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(p.QueryTimeout)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.queryTimeout (5) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:queryTimeout: ", p), err) - } - } - return err + if p.IsSetQueryTimeout() { + if err := oprot.WriteFieldBegin(ctx, "queryTimeout", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:queryTimeout: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.QueryTimeout)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.queryTimeout (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:queryTimeout: ", p), err) } + } + return err } func (p *TExecuteStatementReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) - } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) - } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } + } + return err } func (p *TExecuteStatementReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCanReadArrowResult_() { - if err := oprot.WriteFieldBegin(ctx, "canReadArrowResult", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:canReadArrowResult: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.CanReadArrowResult_)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.canReadArrowResult (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:canReadArrowResult: ", p), err) - } - } - return err + if p.IsSetCanReadArrowResult_() { + if err := oprot.WriteFieldBegin(ctx, "canReadArrowResult", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:canReadArrowResult: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.CanReadArrowResult_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.canReadArrowResult (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:canReadArrowResult: ", p), err) } + } + return err } func (p *TExecuteStatementReq) writeField1283(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCanDownloadResult_() { - if err := oprot.WriteFieldBegin(ctx, "canDownloadResult", thrift.BOOL, 1283); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:canDownloadResult: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.CanDownloadResult_)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.canDownloadResult (1283) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:canDownloadResult: ", p), err) - } - } - return err + if p.IsSetCanDownloadResult_() { + if err := oprot.WriteFieldBegin(ctx, "canDownloadResult", thrift.BOOL, 1283); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:canDownloadResult: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.CanDownloadResult_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.canDownloadResult (1283) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:canDownloadResult: ", p), err) } + } + return err } func (p *TExecuteStatementReq) writeField1284(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCanDecompressLZ4Result_() { - if err := oprot.WriteFieldBegin(ctx, "canDecompressLZ4Result", thrift.BOOL, 1284); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:canDecompressLZ4Result: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.CanDecompressLZ4Result_)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.canDecompressLZ4Result (1284) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:canDecompressLZ4Result: ", p), err) - } - } - return err + if p.IsSetCanDecompressLZ4Result_() { + if err := oprot.WriteFieldBegin(ctx, "canDecompressLZ4Result", thrift.BOOL, 1284); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:canDecompressLZ4Result: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.CanDecompressLZ4Result_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.canDecompressLZ4Result (1284) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:canDecompressLZ4Result: ", p), err) } + } + return err } func (p *TExecuteStatementReq) writeField1285(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetMaxBytesPerFile() { - if err := oprot.WriteFieldBegin(ctx, "maxBytesPerFile", thrift.I64, 1285); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:maxBytesPerFile: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.MaxBytesPerFile)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxBytesPerFile (1285) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:maxBytesPerFile: ", p), err) - } - } - return err + if p.IsSetMaxBytesPerFile() { + if err := oprot.WriteFieldBegin(ctx, "maxBytesPerFile", thrift.I64, 1285); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:maxBytesPerFile: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.MaxBytesPerFile)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxBytesPerFile (1285) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:maxBytesPerFile: ", p), err) } + } + return err } func (p *TExecuteStatementReq) writeField1286(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetUseArrowNativeTypes() { - if err := oprot.WriteFieldBegin(ctx, "useArrowNativeTypes", thrift.STRUCT, 1286); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1286:useArrowNativeTypes: ", p), err) - } - if err := p.UseArrowNativeTypes.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UseArrowNativeTypes), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1286:useArrowNativeTypes: ", p), err) - } - } - return err + if p.IsSetUseArrowNativeTypes() { + if err := oprot.WriteFieldBegin(ctx, "useArrowNativeTypes", thrift.STRUCT, 1286); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1286:useArrowNativeTypes: ", p), err) } + if err := p.UseArrowNativeTypes.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UseArrowNativeTypes), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1286:useArrowNativeTypes: ", p), err) } + } + return err } func (p *TExecuteStatementReq) writeField1287(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResultRowLimit() { - if err := oprot.WriteFieldBegin(ctx, "resultRowLimit", thrift.I64, 1287); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1287:resultRowLimit: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.ResultRowLimit)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.resultRowLimit (1287) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1287:resultRowLimit: ", p), err) - } - } - return err + if p.IsSetResultRowLimit() { + if err := oprot.WriteFieldBegin(ctx, "resultRowLimit", thrift.I64, 1287); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1287:resultRowLimit: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.ResultRowLimit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.resultRowLimit (1287) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1287:resultRowLimit: ", p), err) } + } + return err } func (p *TExecuteStatementReq) writeField1288(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetParameters() { - if err := oprot.WriteFieldBegin(ctx, "parameters", thrift.LIST, 1288); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1288:parameters: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Parameters)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Parameters { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1288:parameters: ", p), err) - } - } - return err + if p.IsSetParameters() { + if err := oprot.WriteFieldBegin(ctx, "parameters", thrift.LIST, 1288); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1288:parameters: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Parameters)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parameters { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1288:parameters: ", p), err) } + } + return err } func (p *TExecuteStatementReq) writeField1289(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetMaxBytesPerBatch() { - if err := oprot.WriteFieldBegin(ctx, "maxBytesPerBatch", thrift.I64, 1289); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1289:maxBytesPerBatch: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.MaxBytesPerBatch)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxBytesPerBatch (1289) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1289:maxBytesPerBatch: ", p), err) - } - } - return err + if p.IsSetMaxBytesPerBatch() { + if err := oprot.WriteFieldBegin(ctx, "maxBytesPerBatch", thrift.I64, 1289); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1289:maxBytesPerBatch: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.MaxBytesPerBatch)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxBytesPerBatch (1289) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1289:maxBytesPerBatch: ", p), err) } + } + return err } func (p *TExecuteStatementReq) writeField1296(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStatementConf() { - if err := oprot.WriteFieldBegin(ctx, "statementConf", thrift.STRUCT, 1296); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1296:statementConf: ", p), err) - } - if err := p.StatementConf.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StatementConf), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1296:statementConf: ", p), err) - } - } - return err + if p.IsSetStatementConf() { + if err := oprot.WriteFieldBegin(ctx, "statementConf", thrift.STRUCT, 1296); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1296:statementConf: ", p), err) } + if err := p.StatementConf.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StatementConf), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1296:statementConf: ", p), err) } + } + return err } func (p *TExecuteStatementReq) Equals(other *TExecuteStatementReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if p.Statement != other.Statement { - return false - } - if len(p.ConfOverlay) != len(other.ConfOverlay) { - return false - } - for k, _tgt := range p.ConfOverlay { - _src60 := other.ConfOverlay[k] - if _tgt != _src60 { - return false - } - } - if p.RunAsync != other.RunAsync { - return false - } - if p.QueryTimeout != other.QueryTimeout { - return false - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { - return false - } - if p.CanReadArrowResult_ != other.CanReadArrowResult_ { - if p.CanReadArrowResult_ == nil || other.CanReadArrowResult_ == nil { - return false - } - if (*p.CanReadArrowResult_) != (*other.CanReadArrowResult_) { - return false - } - } - if p.CanDownloadResult_ != other.CanDownloadResult_ { - if p.CanDownloadResult_ == nil || other.CanDownloadResult_ == nil { - return false - } - if (*p.CanDownloadResult_) != (*other.CanDownloadResult_) { - return false - } - } - if p.CanDecompressLZ4Result_ != other.CanDecompressLZ4Result_ { - if p.CanDecompressLZ4Result_ == nil || other.CanDecompressLZ4Result_ == nil { - return false - } - if (*p.CanDecompressLZ4Result_) != (*other.CanDecompressLZ4Result_) { - return false - } - } - if p.MaxBytesPerFile != other.MaxBytesPerFile { - if p.MaxBytesPerFile == nil || other.MaxBytesPerFile == nil { - return false - } - if (*p.MaxBytesPerFile) != (*other.MaxBytesPerFile) { - return false - } - } - if !p.UseArrowNativeTypes.Equals(other.UseArrowNativeTypes) { - return false - } - if p.ResultRowLimit != other.ResultRowLimit { - if p.ResultRowLimit == nil || other.ResultRowLimit == nil { - return false - } - if (*p.ResultRowLimit) != (*other.ResultRowLimit) { - return false - } - } - if len(p.Parameters) != len(other.Parameters) { - return false - } - for i, _tgt := range p.Parameters { - _src61 := other.Parameters[i] - if !_tgt.Equals(_src61) { - return false - } - } - if p.MaxBytesPerBatch != other.MaxBytesPerBatch { - if p.MaxBytesPerBatch == nil || other.MaxBytesPerBatch == nil { - return false - } - if (*p.MaxBytesPerBatch) != (*other.MaxBytesPerBatch) { - return false - } - } - if !p.StatementConf.Equals(other.StatementConf) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.Statement != other.Statement { return false } + if len(p.ConfOverlay) != len(other.ConfOverlay) { return false } + for k, _tgt := range p.ConfOverlay { + _src60 := other.ConfOverlay[k] + if _tgt != _src60 { return false } + } + if p.RunAsync != other.RunAsync { return false } + if p.QueryTimeout != other.QueryTimeout { return false } + if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } + if p.CanReadArrowResult_ != other.CanReadArrowResult_ { + if p.CanReadArrowResult_ == nil || other.CanReadArrowResult_ == nil { + return false + } + if (*p.CanReadArrowResult_) != (*other.CanReadArrowResult_) { return false } + } + if p.CanDownloadResult_ != other.CanDownloadResult_ { + if p.CanDownloadResult_ == nil || other.CanDownloadResult_ == nil { + return false + } + if (*p.CanDownloadResult_) != (*other.CanDownloadResult_) { return false } + } + if p.CanDecompressLZ4Result_ != other.CanDecompressLZ4Result_ { + if p.CanDecompressLZ4Result_ == nil || other.CanDecompressLZ4Result_ == nil { + return false + } + if (*p.CanDecompressLZ4Result_) != (*other.CanDecompressLZ4Result_) { return false } + } + if p.MaxBytesPerFile != other.MaxBytesPerFile { + if p.MaxBytesPerFile == nil || other.MaxBytesPerFile == nil { + return false + } + if (*p.MaxBytesPerFile) != (*other.MaxBytesPerFile) { return false } + } + if !p.UseArrowNativeTypes.Equals(other.UseArrowNativeTypes) { return false } + if p.ResultRowLimit != other.ResultRowLimit { + if p.ResultRowLimit == nil || other.ResultRowLimit == nil { + return false + } + if (*p.ResultRowLimit) != (*other.ResultRowLimit) { return false } + } + if len(p.Parameters) != len(other.Parameters) { return false } + for i, _tgt := range p.Parameters { + _src61 := other.Parameters[i] + if !_tgt.Equals(_src61) { return false } + } + if p.MaxBytesPerBatch != other.MaxBytesPerBatch { + if p.MaxBytesPerBatch == nil || other.MaxBytesPerBatch == nil { + return false + } + if (*p.MaxBytesPerBatch) != (*other.MaxBytesPerBatch) { return false } + } + if !p.StatementConf.Equals(other.StatementConf) { return false } + return true } func (p *TExecuteStatementReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TExecuteStatementReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TExecuteStatementReq(%+v)", *p) } func (p *TExecuteStatementReq) Validate() error { - return nil + return nil } - // Attributes: -// - StringValue -// - DoubleValue -// - BooleanValue +// - StringValue +// - DoubleValue +// - BooleanValue type TSparkParameterValue struct { - StringValue *string `thrift:"stringValue,1" db:"stringValue" json:"stringValue,omitempty"` - DoubleValue *float64 `thrift:"doubleValue,2" db:"doubleValue" json:"doubleValue,omitempty"` - BooleanValue *bool `thrift:"booleanValue,3" db:"booleanValue" json:"booleanValue,omitempty"` + StringValue *string `thrift:"stringValue,1" db:"stringValue" json:"stringValue,omitempty"` + DoubleValue *float64 `thrift:"doubleValue,2" db:"doubleValue" json:"doubleValue,omitempty"` + BooleanValue *bool `thrift:"booleanValue,3" db:"booleanValue" json:"booleanValue,omitempty"` } func NewTSparkParameterValue() *TSparkParameterValue { - return &TSparkParameterValue{} + return &TSparkParameterValue{} } var TSparkParameterValue_StringValue_DEFAULT string - func (p *TSparkParameterValue) GetStringValue() string { - if !p.IsSetStringValue() { - return TSparkParameterValue_StringValue_DEFAULT - } - return *p.StringValue + if !p.IsSetStringValue() { + return TSparkParameterValue_StringValue_DEFAULT + } +return *p.StringValue } - var TSparkParameterValue_DoubleValue_DEFAULT float64 - func (p *TSparkParameterValue) GetDoubleValue() float64 { - if !p.IsSetDoubleValue() { - return TSparkParameterValue_DoubleValue_DEFAULT - } - return *p.DoubleValue + if !p.IsSetDoubleValue() { + return TSparkParameterValue_DoubleValue_DEFAULT + } +return *p.DoubleValue } - var TSparkParameterValue_BooleanValue_DEFAULT bool - func (p *TSparkParameterValue) GetBooleanValue() bool { - if !p.IsSetBooleanValue() { - return TSparkParameterValue_BooleanValue_DEFAULT - } - return *p.BooleanValue + if !p.IsSetBooleanValue() { + return TSparkParameterValue_BooleanValue_DEFAULT + } +return *p.BooleanValue } func (p *TSparkParameterValue) CountSetFieldsTSparkParameterValue() int { - count := 0 - if p.IsSetStringValue() { - count++ - } - if p.IsSetDoubleValue() { - count++ - } - if p.IsSetBooleanValue() { - count++ - } - return count + count := 0 + if (p.IsSetStringValue()) { + count++ + } + if (p.IsSetDoubleValue()) { + count++ + } + if (p.IsSetBooleanValue()) { + count++ + } + return count } func (p *TSparkParameterValue) IsSetStringValue() bool { - return p.StringValue != nil + return p.StringValue != nil } func (p *TSparkParameterValue) IsSetDoubleValue() bool { - return p.DoubleValue != nil + return p.DoubleValue != nil } func (p *TSparkParameterValue) IsSetBooleanValue() bool { - return p.BooleanValue != nil + return p.BooleanValue != nil } func (p *TSparkParameterValue) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TSparkParameterValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.StringValue = &v - } - return nil -} - -func (p *TSparkParameterValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.DoubleValue = &v - } - return nil -} - -func (p *TSparkParameterValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.BooleanValue = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TSparkParameterValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.StringValue = &v +} + return nil +} + +func (p *TSparkParameterValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.DoubleValue = &v +} + return nil +} + +func (p *TSparkParameterValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.BooleanValue = &v +} + return nil } func (p *TSparkParameterValue) Write(ctx context.Context, oprot thrift.TProtocol) error { - if c := p.CountSetFieldsTSparkParameterValue(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) - } - if err := oprot.WriteStructBegin(ctx, "TSparkParameterValue"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if c := p.CountSetFieldsTSparkParameterValue(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "TSparkParameterValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TSparkParameterValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStringValue() { - if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:stringValue: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.stringValue (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:stringValue: ", p), err) - } - } - return err + if p.IsSetStringValue() { + if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:stringValue: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stringValue (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:stringValue: ", p), err) } + } + return err } func (p *TSparkParameterValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDoubleValue() { - if err := oprot.WriteFieldBegin(ctx, "doubleValue", thrift.DOUBLE, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:doubleValue: ", p), err) - } - if err := oprot.WriteDouble(ctx, float64(*p.DoubleValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.doubleValue (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:doubleValue: ", p), err) - } - } - return err + if p.IsSetDoubleValue() { + if err := oprot.WriteFieldBegin(ctx, "doubleValue", thrift.DOUBLE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:doubleValue: ", p), err) } + if err := oprot.WriteDouble(ctx, float64(*p.DoubleValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.doubleValue (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:doubleValue: ", p), err) } + } + return err } func (p *TSparkParameterValue) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetBooleanValue() { - if err := oprot.WriteFieldBegin(ctx, "booleanValue", thrift.BOOL, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:booleanValue: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.BooleanValue)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.booleanValue (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:booleanValue: ", p), err) - } - } - return err + if p.IsSetBooleanValue() { + if err := oprot.WriteFieldBegin(ctx, "booleanValue", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:booleanValue: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.BooleanValue)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.booleanValue (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:booleanValue: ", p), err) } + } + return err } func (p *TSparkParameterValue) Equals(other *TSparkParameterValue) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.StringValue != other.StringValue { - if p.StringValue == nil || other.StringValue == nil { - return false - } - if (*p.StringValue) != (*other.StringValue) { - return false - } - } - if p.DoubleValue != other.DoubleValue { - if p.DoubleValue == nil || other.DoubleValue == nil { - return false - } - if (*p.DoubleValue) != (*other.DoubleValue) { - return false - } - } - if p.BooleanValue != other.BooleanValue { - if p.BooleanValue == nil || other.BooleanValue == nil { - return false - } - if (*p.BooleanValue) != (*other.BooleanValue) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StringValue != other.StringValue { + if p.StringValue == nil || other.StringValue == nil { + return false + } + if (*p.StringValue) != (*other.StringValue) { return false } + } + if p.DoubleValue != other.DoubleValue { + if p.DoubleValue == nil || other.DoubleValue == nil { + return false + } + if (*p.DoubleValue) != (*other.DoubleValue) { return false } + } + if p.BooleanValue != other.BooleanValue { + if p.BooleanValue == nil || other.BooleanValue == nil { + return false + } + if (*p.BooleanValue) != (*other.BooleanValue) { return false } + } + return true } func (p *TSparkParameterValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkParameterValue(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkParameterValue(%+v)", *p) } func (p *TSparkParameterValue) Validate() error { - return nil + return nil } - // Attributes: -// - Type -// - Value -// - Arguments +// - Type +// - Value +// - Arguments type TSparkParameterValueArg struct { - Type *string `thrift:"type,1" db:"type" json:"type,omitempty"` - Value *string `thrift:"value,2" db:"value" json:"value,omitempty"` - Arguments []*TSparkParameterValueArg `thrift:"arguments,3" db:"arguments" json:"arguments,omitempty"` + Type *string `thrift:"type,1" db:"type" json:"type,omitempty"` + Value *string `thrift:"value,2" db:"value" json:"value,omitempty"` + Arguments []*TSparkParameterValueArg `thrift:"arguments,3" db:"arguments" json:"arguments,omitempty"` } func NewTSparkParameterValueArg() *TSparkParameterValueArg { - return &TSparkParameterValueArg{} + return &TSparkParameterValueArg{} } var TSparkParameterValueArg_Type_DEFAULT string - func (p *TSparkParameterValueArg) GetType() string { - if !p.IsSetType() { - return TSparkParameterValueArg_Type_DEFAULT - } - return *p.Type + if !p.IsSetType() { + return TSparkParameterValueArg_Type_DEFAULT + } +return *p.Type } - var TSparkParameterValueArg_Value_DEFAULT string - func (p *TSparkParameterValueArg) GetValue() string { - if !p.IsSetValue() { - return TSparkParameterValueArg_Value_DEFAULT - } - return *p.Value + if !p.IsSetValue() { + return TSparkParameterValueArg_Value_DEFAULT + } +return *p.Value } - var TSparkParameterValueArg_Arguments_DEFAULT []*TSparkParameterValueArg func (p *TSparkParameterValueArg) GetArguments() []*TSparkParameterValueArg { - return p.Arguments + return p.Arguments } func (p *TSparkParameterValueArg) IsSetType() bool { - return p.Type != nil + return p.Type != nil } func (p *TSparkParameterValueArg) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TSparkParameterValueArg) IsSetArguments() bool { - return p.Arguments != nil + return p.Arguments != nil } func (p *TSparkParameterValueArg) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.LIST { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TSparkParameterValueArg) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Type = &v - } - return nil -} - -func (p *TSparkParameterValueArg) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Value = &v - } - return nil -} - -func (p *TSparkParameterValueArg) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TSparkParameterValueArg, 0, size) - p.Arguments = tSlice - for i := 0; i < size; i++ { - _elem62 := &TSparkParameterValueArg{} - if err := _elem62.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) - } - p.Arguments = append(p.Arguments, _elem62) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TSparkParameterValueArg) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Type = &v +} + return nil +} + +func (p *TSparkParameterValueArg) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = &v +} + return nil +} + +func (p *TSparkParameterValueArg) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TSparkParameterValueArg, 0, size) + p.Arguments = tSlice + for i := 0; i < size; i ++ { + _elem62 := &TSparkParameterValueArg{} + if err := _elem62.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) + } + p.Arguments = append(p.Arguments, _elem62) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TSparkParameterValueArg) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkParameterValueArg"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkParameterValueArg"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TSparkParameterValueArg) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetType() { - if err := oprot.WriteFieldBegin(ctx, "type", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.Type)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) - } - } - return err + if p.IsSetType() { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + } + return err } func (p *TSparkParameterValueArg) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.Value)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) - } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.Value)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + } + return err } func (p *TSparkParameterValueArg) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArguments() { - if err := oprot.WriteFieldBegin(ctx, "arguments", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:arguments: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Arguments)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Arguments { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:arguments: ", p), err) - } - } - return err + if p.IsSetArguments() { + if err := oprot.WriteFieldBegin(ctx, "arguments", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:arguments: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Arguments)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Arguments { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:arguments: ", p), err) } + } + return err } func (p *TSparkParameterValueArg) Equals(other *TSparkParameterValueArg) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Type != other.Type { - if p.Type == nil || other.Type == nil { - return false - } - if (*p.Type) != (*other.Type) { - return false - } - } - if p.Value != other.Value { - if p.Value == nil || other.Value == nil { - return false - } - if (*p.Value) != (*other.Value) { - return false - } - } - if len(p.Arguments) != len(other.Arguments) { - return false - } - for i, _tgt := range p.Arguments { - _src63 := other.Arguments[i] - if !_tgt.Equals(_src63) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Type != other.Type { + if p.Type == nil || other.Type == nil { + return false + } + if (*p.Type) != (*other.Type) { return false } + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + if len(p.Arguments) != len(other.Arguments) { return false } + for i, _tgt := range p.Arguments { + _src63 := other.Arguments[i] + if !_tgt.Equals(_src63) { return false } + } + return true } func (p *TSparkParameterValueArg) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkParameterValueArg(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkParameterValueArg(%+v)", *p) } func (p *TSparkParameterValueArg) Validate() error { - return nil + return nil } - // Attributes: -// - Ordinal -// - Name -// - Type -// - Value -// - Arguments +// - Ordinal +// - Name +// - Type +// - Value +// - Arguments type TSparkParameter struct { - Ordinal *int32 `thrift:"ordinal,1" db:"ordinal" json:"ordinal,omitempty"` - Name *string `thrift:"name,2" db:"name" json:"name,omitempty"` - Type *string `thrift:"type,3" db:"type" json:"type,omitempty"` - Value *TSparkParameterValue `thrift:"value,4" db:"value" json:"value,omitempty"` - Arguments []*TSparkParameterValueArg `thrift:"arguments,5" db:"arguments" json:"arguments,omitempty"` + Ordinal *int32 `thrift:"ordinal,1" db:"ordinal" json:"ordinal,omitempty"` + Name *string `thrift:"name,2" db:"name" json:"name,omitempty"` + Type *string `thrift:"type,3" db:"type" json:"type,omitempty"` + Value *TSparkParameterValue `thrift:"value,4" db:"value" json:"value,omitempty"` + Arguments []*TSparkParameterValueArg `thrift:"arguments,5" db:"arguments" json:"arguments,omitempty"` } func NewTSparkParameter() *TSparkParameter { - return &TSparkParameter{} + return &TSparkParameter{} } var TSparkParameter_Ordinal_DEFAULT int32 - func (p *TSparkParameter) GetOrdinal() int32 { - if !p.IsSetOrdinal() { - return TSparkParameter_Ordinal_DEFAULT - } - return *p.Ordinal + if !p.IsSetOrdinal() { + return TSparkParameter_Ordinal_DEFAULT + } +return *p.Ordinal } - var TSparkParameter_Name_DEFAULT string - func (p *TSparkParameter) GetName() string { - if !p.IsSetName() { - return TSparkParameter_Name_DEFAULT - } - return *p.Name + if !p.IsSetName() { + return TSparkParameter_Name_DEFAULT + } +return *p.Name } - var TSparkParameter_Type_DEFAULT string - func (p *TSparkParameter) GetType() string { - if !p.IsSetType() { - return TSparkParameter_Type_DEFAULT - } - return *p.Type + if !p.IsSetType() { + return TSparkParameter_Type_DEFAULT + } +return *p.Type } - var TSparkParameter_Value_DEFAULT *TSparkParameterValue - func (p *TSparkParameter) GetValue() *TSparkParameterValue { - if !p.IsSetValue() { - return TSparkParameter_Value_DEFAULT - } - return p.Value + if !p.IsSetValue() { + return TSparkParameter_Value_DEFAULT + } +return p.Value } - var TSparkParameter_Arguments_DEFAULT []*TSparkParameterValueArg func (p *TSparkParameter) GetArguments() []*TSparkParameterValueArg { - return p.Arguments + return p.Arguments } func (p *TSparkParameter) IsSetOrdinal() bool { - return p.Ordinal != nil + return p.Ordinal != nil } func (p *TSparkParameter) IsSetName() bool { - return p.Name != nil + return p.Name != nil } func (p *TSparkParameter) IsSetType() bool { - return p.Type != nil + return p.Type != nil } func (p *TSparkParameter) IsSetValue() bool { - return p.Value != nil + return p.Value != nil } func (p *TSparkParameter) IsSetArguments() bool { - return p.Arguments != nil + return p.Arguments != nil } func (p *TSparkParameter) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.LIST { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TSparkParameter) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Ordinal = &v - } - return nil -} - -func (p *TSparkParameter) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Name = &v - } - return nil -} - -func (p *TSparkParameter) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.Type = &v - } - return nil -} - -func (p *TSparkParameter) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - p.Value = &TSparkParameterValue{} - if err := p.Value.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) - } - return nil -} - -func (p *TSparkParameter) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*TSparkParameterValueArg, 0, size) - p.Arguments = tSlice - for i := 0; i < size; i++ { - _elem64 := &TSparkParameterValueArg{} - if err := _elem64.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem64), err) - } - p.Arguments = append(p.Arguments, _elem64) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.LIST { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TSparkParameter) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Ordinal = &v +} + return nil +} + +func (p *TSparkParameter) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = &v +} + return nil +} + +func (p *TSparkParameter) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Type = &v +} + return nil +} + +func (p *TSparkParameter) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.Value = &TSparkParameterValue{} + if err := p.Value.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) + } + return nil +} + +func (p *TSparkParameter) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*TSparkParameterValueArg, 0, size) + p.Arguments = tSlice + for i := 0; i < size; i ++ { + _elem64 := &TSparkParameterValueArg{} + if err := _elem64.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem64), err) + } + p.Arguments = append(p.Arguments, _elem64) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil } func (p *TSparkParameter) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TSparkParameter"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TSparkParameter"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TSparkParameter) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOrdinal() { - if err := oprot.WriteFieldBegin(ctx, "ordinal", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ordinal: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.Ordinal)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.ordinal (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ordinal: ", p), err) - } - } - return err + if p.IsSetOrdinal() { + if err := oprot.WriteFieldBegin(ctx, "ordinal", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ordinal: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.Ordinal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ordinal (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ordinal: ", p), err) } + } + return err } func (p *TSparkParameter) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetName() { - if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.Name)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) - } - } - return err + if p.IsSetName() { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.Name)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + } + return err } func (p *TSparkParameter) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetType() { - if err := oprot.WriteFieldBegin(ctx, "type", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.Type)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.type (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type: ", p), err) - } - } - return err + if p.IsSetType() { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type: ", p), err) } + } + return err } func (p *TSparkParameter) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetValue() { - if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:value: ", p), err) - } - if err := p.Value.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:value: ", p), err) - } - } - return err + if p.IsSetValue() { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:value: ", p), err) } + if err := p.Value.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:value: ", p), err) } + } + return err } func (p *TSparkParameter) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArguments() { - if err := oprot.WriteFieldBegin(ctx, "arguments", thrift.LIST, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:arguments: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Arguments)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Arguments { - if err := v.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:arguments: ", p), err) - } - } - return err + if p.IsSetArguments() { + if err := oprot.WriteFieldBegin(ctx, "arguments", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:arguments: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Arguments)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Arguments { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:arguments: ", p), err) } + } + return err } func (p *TSparkParameter) Equals(other *TSparkParameter) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Ordinal != other.Ordinal { - if p.Ordinal == nil || other.Ordinal == nil { - return false - } - if (*p.Ordinal) != (*other.Ordinal) { - return false - } - } - if p.Name != other.Name { - if p.Name == nil || other.Name == nil { - return false - } - if (*p.Name) != (*other.Name) { - return false - } - } - if p.Type != other.Type { - if p.Type == nil || other.Type == nil { - return false - } - if (*p.Type) != (*other.Type) { - return false - } - } - if !p.Value.Equals(other.Value) { - return false - } - if len(p.Arguments) != len(other.Arguments) { - return false - } - for i, _tgt := range p.Arguments { - _src65 := other.Arguments[i] - if !_tgt.Equals(_src65) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Ordinal != other.Ordinal { + if p.Ordinal == nil || other.Ordinal == nil { + return false + } + if (*p.Ordinal) != (*other.Ordinal) { return false } + } + if p.Name != other.Name { + if p.Name == nil || other.Name == nil { + return false + } + if (*p.Name) != (*other.Name) { return false } + } + if p.Type != other.Type { + if p.Type == nil || other.Type == nil { + return false + } + if (*p.Type) != (*other.Type) { return false } + } + if !p.Value.Equals(other.Value) { return false } + if len(p.Arguments) != len(other.Arguments) { return false } + for i, _tgt := range p.Arguments { + _src65 := other.Arguments[i] + if !_tgt.Equals(_src65) { return false } + } + return true } func (p *TSparkParameter) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSparkParameter(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TSparkParameter(%+v)", *p) } func (p *TSparkParameter) Validate() error { - return nil + return nil } - // Attributes: -// - Sessionless -// - InitialNamespace -// - ClientProtocol -// - ClientProtocolI64 +// - Sessionless +// - InitialNamespace +// - ClientProtocol +// - ClientProtocolI64 type TStatementConf struct { - Sessionless *bool `thrift:"sessionless,1" db:"sessionless" json:"sessionless,omitempty"` - InitialNamespace *TNamespace `thrift:"initialNamespace,2" db:"initialNamespace" json:"initialNamespace,omitempty"` - ClientProtocol *TProtocolVersion `thrift:"client_protocol,3" db:"client_protocol" json:"client_protocol,omitempty"` - ClientProtocolI64 *int64 `thrift:"client_protocol_i64,4" db:"client_protocol_i64" json:"client_protocol_i64,omitempty"` + Sessionless *bool `thrift:"sessionless,1" db:"sessionless" json:"sessionless,omitempty"` + InitialNamespace *TNamespace `thrift:"initialNamespace,2" db:"initialNamespace" json:"initialNamespace,omitempty"` + ClientProtocol *TProtocolVersion `thrift:"client_protocol,3" db:"client_protocol" json:"client_protocol,omitempty"` + ClientProtocolI64 *int64 `thrift:"client_protocol_i64,4" db:"client_protocol_i64" json:"client_protocol_i64,omitempty"` } func NewTStatementConf() *TStatementConf { - return &TStatementConf{} + return &TStatementConf{} } var TStatementConf_Sessionless_DEFAULT bool - func (p *TStatementConf) GetSessionless() bool { - if !p.IsSetSessionless() { - return TStatementConf_Sessionless_DEFAULT - } - return *p.Sessionless + if !p.IsSetSessionless() { + return TStatementConf_Sessionless_DEFAULT + } +return *p.Sessionless } - var TStatementConf_InitialNamespace_DEFAULT *TNamespace - func (p *TStatementConf) GetInitialNamespace() *TNamespace { - if !p.IsSetInitialNamespace() { - return TStatementConf_InitialNamespace_DEFAULT - } - return p.InitialNamespace + if !p.IsSetInitialNamespace() { + return TStatementConf_InitialNamespace_DEFAULT + } +return p.InitialNamespace } - var TStatementConf_ClientProtocol_DEFAULT TProtocolVersion - func (p *TStatementConf) GetClientProtocol() TProtocolVersion { - if !p.IsSetClientProtocol() { - return TStatementConf_ClientProtocol_DEFAULT - } - return *p.ClientProtocol + if !p.IsSetClientProtocol() { + return TStatementConf_ClientProtocol_DEFAULT + } +return *p.ClientProtocol } - var TStatementConf_ClientProtocolI64_DEFAULT int64 - func (p *TStatementConf) GetClientProtocolI64() int64 { - if !p.IsSetClientProtocolI64() { - return TStatementConf_ClientProtocolI64_DEFAULT - } - return *p.ClientProtocolI64 + if !p.IsSetClientProtocolI64() { + return TStatementConf_ClientProtocolI64_DEFAULT + } +return *p.ClientProtocolI64 } func (p *TStatementConf) IsSetSessionless() bool { - return p.Sessionless != nil + return p.Sessionless != nil } func (p *TStatementConf) IsSetInitialNamespace() bool { - return p.InitialNamespace != nil + return p.InitialNamespace != nil } func (p *TStatementConf) IsSetClientProtocol() bool { - return p.ClientProtocol != nil + return p.ClientProtocol != nil } func (p *TStatementConf) IsSetClientProtocolI64() bool { - return p.ClientProtocolI64 != nil + return p.ClientProtocolI64 != nil } func (p *TStatementConf) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I32 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I64 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TStatementConf) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Sessionless = &v - } - return nil -} - -func (p *TStatementConf) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.InitialNamespace = &TNamespace{} - if err := p.InitialNamespace.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InitialNamespace), err) - } - return nil -} - -func (p *TStatementConf) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - temp := TProtocolVersion(v) - p.ClientProtocol = &temp - } - return nil -} - -func (p *TStatementConf) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.ClientProtocolI64 = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TStatementConf) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Sessionless = &v +} + return nil +} + +func (p *TStatementConf) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.InitialNamespace = &TNamespace{} + if err := p.InitialNamespace.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InitialNamespace), err) + } + return nil +} + +func (p *TStatementConf) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := TProtocolVersion(v) + p.ClientProtocol = &temp +} + return nil +} + +func (p *TStatementConf) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.ClientProtocolI64 = &v +} + return nil } func (p *TStatementConf) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TStatementConf"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TStatementConf"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TStatementConf) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSessionless() { - if err := oprot.WriteFieldBegin(ctx, "sessionless", thrift.BOOL, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionless: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.Sessionless)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.sessionless (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionless: ", p), err) - } - } - return err + if p.IsSetSessionless() { + if err := oprot.WriteFieldBegin(ctx, "sessionless", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionless: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.Sessionless)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionless (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionless: ", p), err) } + } + return err } func (p *TStatementConf) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetInitialNamespace() { - if err := oprot.WriteFieldBegin(ctx, "initialNamespace", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:initialNamespace: ", p), err) - } - if err := p.InitialNamespace.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InitialNamespace), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:initialNamespace: ", p), err) - } - } - return err + if p.IsSetInitialNamespace() { + if err := oprot.WriteFieldBegin(ctx, "initialNamespace", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:initialNamespace: ", p), err) } + if err := p.InitialNamespace.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InitialNamespace), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:initialNamespace: ", p), err) } + } + return err } func (p *TStatementConf) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetClientProtocol() { - if err := oprot.WriteFieldBegin(ctx, "client_protocol", thrift.I32, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:client_protocol: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.ClientProtocol)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.client_protocol (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:client_protocol: ", p), err) - } - } - return err + if p.IsSetClientProtocol() { + if err := oprot.WriteFieldBegin(ctx, "client_protocol", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:client_protocol: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.ClientProtocol)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_protocol (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:client_protocol: ", p), err) } + } + return err } func (p *TStatementConf) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetClientProtocolI64() { - if err := oprot.WriteFieldBegin(ctx, "client_protocol_i64", thrift.I64, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:client_protocol_i64: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.ClientProtocolI64)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.client_protocol_i64 (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:client_protocol_i64: ", p), err) - } - } - return err + if p.IsSetClientProtocolI64() { + if err := oprot.WriteFieldBegin(ctx, "client_protocol_i64", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:client_protocol_i64: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.ClientProtocolI64)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_protocol_i64 (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:client_protocol_i64: ", p), err) } + } + return err } func (p *TStatementConf) Equals(other *TStatementConf) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if p.Sessionless != other.Sessionless { - if p.Sessionless == nil || other.Sessionless == nil { - return false - } - if (*p.Sessionless) != (*other.Sessionless) { - return false - } - } - if !p.InitialNamespace.Equals(other.InitialNamespace) { - return false - } - if p.ClientProtocol != other.ClientProtocol { - if p.ClientProtocol == nil || other.ClientProtocol == nil { - return false - } - if (*p.ClientProtocol) != (*other.ClientProtocol) { - return false - } - } - if p.ClientProtocolI64 != other.ClientProtocolI64 { - if p.ClientProtocolI64 == nil || other.ClientProtocolI64 == nil { - return false - } - if (*p.ClientProtocolI64) != (*other.ClientProtocolI64) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Sessionless != other.Sessionless { + if p.Sessionless == nil || other.Sessionless == nil { + return false + } + if (*p.Sessionless) != (*other.Sessionless) { return false } + } + if !p.InitialNamespace.Equals(other.InitialNamespace) { return false } + if p.ClientProtocol != other.ClientProtocol { + if p.ClientProtocol == nil || other.ClientProtocol == nil { + return false + } + if (*p.ClientProtocol) != (*other.ClientProtocol) { return false } + } + if p.ClientProtocolI64 != other.ClientProtocolI64 { + if p.ClientProtocolI64 == nil || other.ClientProtocolI64 == nil { + return false + } + if (*p.ClientProtocolI64) != (*other.ClientProtocolI64) { return false } + } + return true } func (p *TStatementConf) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TStatementConf(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TStatementConf(%+v)", *p) } func (p *TStatementConf) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TExecuteStatementResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTExecuteStatementResp() *TExecuteStatementResp { - return &TExecuteStatementResp{} + return &TExecuteStatementResp{} } var TExecuteStatementResp_Status_DEFAULT *TStatus - func (p *TExecuteStatementResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TExecuteStatementResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TExecuteStatementResp_Status_DEFAULT + } +return p.Status } - var TExecuteStatementResp_OperationHandle_DEFAULT *TOperationHandle - func (p *TExecuteStatementResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TExecuteStatementResp_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TExecuteStatementResp_OperationHandle_DEFAULT + } +return p.OperationHandle } - var TExecuteStatementResp_DirectResults_DEFAULT *TSparkDirectResults - func (p *TExecuteStatementResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TExecuteStatementResp_DirectResults_DEFAULT - } - return p.DirectResults + if !p.IsSetDirectResults() { + return TExecuteStatementResp_DirectResults_DEFAULT + } +return p.DirectResults } func (p *TExecuteStatementResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TExecuteStatementResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TExecuteStatementResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TExecuteStatementResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TExecuteStatementResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TExecuteStatementResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TExecuteStatementResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TExecuteStatementResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TExecuteStatementResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TExecuteStatementResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TExecuteStatementResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TExecuteStatementResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TExecuteStatementResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TExecuteStatementResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TExecuteStatementResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) - } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } + } + return err } func (p *TExecuteStatementResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) - } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) - } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } + } + return err } func (p *TExecuteStatementResp) Equals(other *TExecuteStatementResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - if !p.DirectResults.Equals(other.DirectResults) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if !p.DirectResults.Equals(other.DirectResults) { return false } + return true } func (p *TExecuteStatementResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TExecuteStatementResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TExecuteStatementResp(%+v)", *p) } func (p *TExecuteStatementResp) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - GetDirectResults +// - RunAsync type TGetTypeInfoReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - // unused fields # 2 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + // unused fields # 2 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetTypeInfoReq() *TGetTypeInfoReq { - return &TGetTypeInfoReq{} + return &TGetTypeInfoReq{} } var TGetTypeInfoReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TGetTypeInfoReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetTypeInfoReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetTypeInfoReq_SessionHandle_DEFAULT + } +return p.SessionHandle } - var TGetTypeInfoReq_GetDirectResults_DEFAULT *TSparkGetDirectResults - func (p *TGetTypeInfoReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetTypeInfoReq_GetDirectResults_DEFAULT - } - return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetTypeInfoReq_GetDirectResults_DEFAULT + } +return p.GetDirectResults } - var TGetTypeInfoReq_RunAsync_DEFAULT bool = false func (p *TGetTypeInfoReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetTypeInfoReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetTypeInfoReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetTypeInfoReq) IsSetRunAsync() bool { - return p.RunAsync != TGetTypeInfoReq_RunAsync_DEFAULT + return p.RunAsync != TGetTypeInfoReq_RunAsync_DEFAULT } func (p *TGetTypeInfoReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - return nil -} - -func (p *TGetTypeInfoReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetTypeInfoReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetTypeInfoReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.RunAsync = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + return nil +} + +func (p *TGetTypeInfoReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetTypeInfoReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetTypeInfoReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.RunAsync = v +} + return nil } func (p *TGetTypeInfoReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTypeInfoReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetTypeInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetTypeInfoReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TGetTypeInfoReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) - } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) - } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } + } + return err } func (p *TGetTypeInfoReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) - } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } + } + return err } func (p *TGetTypeInfoReq) Equals(other *TGetTypeInfoReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { - return false - } - if p.RunAsync != other.RunAsync { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } + if p.RunAsync != other.RunAsync { return false } + return true } func (p *TGetTypeInfoReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetTypeInfoReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTypeInfoReq(%+v)", *p) } func (p *TGetTypeInfoReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetTypeInfoResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetTypeInfoResp() *TGetTypeInfoResp { - return &TGetTypeInfoResp{} + return &TGetTypeInfoResp{} } var TGetTypeInfoResp_Status_DEFAULT *TStatus - func (p *TGetTypeInfoResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetTypeInfoResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TGetTypeInfoResp_Status_DEFAULT + } +return p.Status } - var TGetTypeInfoResp_OperationHandle_DEFAULT *TOperationHandle - func (p *TGetTypeInfoResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetTypeInfoResp_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetTypeInfoResp_OperationHandle_DEFAULT + } +return p.OperationHandle } - var TGetTypeInfoResp_DirectResults_DEFAULT *TSparkDirectResults - func (p *TGetTypeInfoResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetTypeInfoResp_DirectResults_DEFAULT - } - return p.DirectResults + if !p.IsSetDirectResults() { + return TGetTypeInfoResp_DirectResults_DEFAULT + } +return p.DirectResults } func (p *TGetTypeInfoResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetTypeInfoResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetTypeInfoResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetTypeInfoResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TGetTypeInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetTypeInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetTypeInfoResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetTypeInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetTypeInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetTypeInfoResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetTypeInfoResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTypeInfoResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetTypeInfoResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetTypeInfoResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TGetTypeInfoResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) - } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } + } + return err } func (p *TGetTypeInfoResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) - } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) - } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } + } + return err } func (p *TGetTypeInfoResp) Equals(other *TGetTypeInfoResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - if !p.DirectResults.Equals(other.DirectResults) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if !p.DirectResults.Equals(other.DirectResults) { return false } + return true } func (p *TGetTypeInfoResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetTypeInfoResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTypeInfoResp(%+v)", *p) } func (p *TGetTypeInfoResp) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - GetDirectResults +// - RunAsync type TGetCatalogsReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - // unused fields # 2 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + // unused fields # 2 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetCatalogsReq() *TGetCatalogsReq { - return &TGetCatalogsReq{} + return &TGetCatalogsReq{} } var TGetCatalogsReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TGetCatalogsReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetCatalogsReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetCatalogsReq_SessionHandle_DEFAULT + } +return p.SessionHandle } - var TGetCatalogsReq_GetDirectResults_DEFAULT *TSparkGetDirectResults - func (p *TGetCatalogsReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetCatalogsReq_GetDirectResults_DEFAULT - } - return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetCatalogsReq_GetDirectResults_DEFAULT + } +return p.GetDirectResults } - var TGetCatalogsReq_RunAsync_DEFAULT bool = false func (p *TGetCatalogsReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetCatalogsReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetCatalogsReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetCatalogsReq) IsSetRunAsync() bool { - return p.RunAsync != TGetCatalogsReq_RunAsync_DEFAULT + return p.RunAsync != TGetCatalogsReq_RunAsync_DEFAULT } func (p *TGetCatalogsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - return nil -} - -func (p *TGetCatalogsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetCatalogsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetCatalogsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.RunAsync = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + return nil +} + +func (p *TGetCatalogsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetCatalogsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetCatalogsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.RunAsync = v +} + return nil } func (p *TGetCatalogsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetCatalogsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetCatalogsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetCatalogsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TGetCatalogsReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) - } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) - } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } + } + return err } func (p *TGetCatalogsReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) - } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } + } + return err } func (p *TGetCatalogsReq) Equals(other *TGetCatalogsReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { - return false - } - if p.RunAsync != other.RunAsync { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } + if p.RunAsync != other.RunAsync { return false } + return true } func (p *TGetCatalogsReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetCatalogsReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetCatalogsReq(%+v)", *p) } func (p *TGetCatalogsReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetCatalogsResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetCatalogsResp() *TGetCatalogsResp { - return &TGetCatalogsResp{} + return &TGetCatalogsResp{} } var TGetCatalogsResp_Status_DEFAULT *TStatus - func (p *TGetCatalogsResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetCatalogsResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TGetCatalogsResp_Status_DEFAULT + } +return p.Status } - var TGetCatalogsResp_OperationHandle_DEFAULT *TOperationHandle - func (p *TGetCatalogsResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetCatalogsResp_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetCatalogsResp_OperationHandle_DEFAULT + } +return p.OperationHandle } - var TGetCatalogsResp_DirectResults_DEFAULT *TSparkDirectResults - func (p *TGetCatalogsResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetCatalogsResp_DirectResults_DEFAULT - } - return p.DirectResults + if !p.IsSetDirectResults() { + return TGetCatalogsResp_DirectResults_DEFAULT + } +return p.DirectResults } func (p *TGetCatalogsResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetCatalogsResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetCatalogsResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetCatalogsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TGetCatalogsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetCatalogsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetCatalogsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetCatalogsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetCatalogsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetCatalogsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetCatalogsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetCatalogsResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetCatalogsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetCatalogsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TGetCatalogsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) - } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } + } + return err } func (p *TGetCatalogsResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) - } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) - } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } + } + return err } func (p *TGetCatalogsResp) Equals(other *TGetCatalogsResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - if !p.DirectResults.Equals(other.DirectResults) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if !p.DirectResults.Equals(other.DirectResults) { return false } + return true } func (p *TGetCatalogsResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetCatalogsResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetCatalogsResp(%+v)", *p) } func (p *TGetCatalogsResp) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - CatalogName -// - SchemaName -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - CatalogName +// - SchemaName +// - GetDirectResults +// - RunAsync type TGetSchemasReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` - SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` - // unused fields # 4 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` + // unused fields # 4 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetSchemasReq() *TGetSchemasReq { - return &TGetSchemasReq{} + return &TGetSchemasReq{} } var TGetSchemasReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TGetSchemasReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetSchemasReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetSchemasReq_SessionHandle_DEFAULT + } +return p.SessionHandle } - var TGetSchemasReq_CatalogName_DEFAULT TIdentifier - func (p *TGetSchemasReq) GetCatalogName() TIdentifier { - if !p.IsSetCatalogName() { - return TGetSchemasReq_CatalogName_DEFAULT - } - return *p.CatalogName + if !p.IsSetCatalogName() { + return TGetSchemasReq_CatalogName_DEFAULT + } +return *p.CatalogName } - var TGetSchemasReq_SchemaName_DEFAULT TPatternOrIdentifier - func (p *TGetSchemasReq) GetSchemaName() TPatternOrIdentifier { - if !p.IsSetSchemaName() { - return TGetSchemasReq_SchemaName_DEFAULT - } - return *p.SchemaName + if !p.IsSetSchemaName() { + return TGetSchemasReq_SchemaName_DEFAULT + } +return *p.SchemaName } - var TGetSchemasReq_GetDirectResults_DEFAULT *TSparkGetDirectResults - func (p *TGetSchemasReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetSchemasReq_GetDirectResults_DEFAULT - } - return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetSchemasReq_GetDirectResults_DEFAULT + } +return p.GetDirectResults } - var TGetSchemasReq_RunAsync_DEFAULT bool = false func (p *TGetSchemasReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetSchemasReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetSchemasReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetSchemasReq) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TGetSchemasReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetSchemasReq) IsSetRunAsync() bool { - return p.RunAsync != TGetSchemasReq_RunAsync_DEFAULT + return p.RunAsync != TGetSchemasReq_RunAsync_DEFAULT } func (p *TGetSchemasReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - return nil -} - -func (p *TGetSchemasReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetSchemasReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TIdentifier(v) - p.CatalogName = &temp - } - return nil -} - -func (p *TGetSchemasReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - temp := TPatternOrIdentifier(v) - p.SchemaName = &temp - } - return nil -} - -func (p *TGetSchemasReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetSchemasReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.RunAsync = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + return nil +} + +func (p *TGetSchemasReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetSchemasReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TIdentifier(v) + p.CatalogName = &temp +} + return nil +} + +func (p *TGetSchemasReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := TPatternOrIdentifier(v) + p.SchemaName = &temp +} + return nil +} + +func (p *TGetSchemasReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetSchemasReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.RunAsync = v +} + return nil } func (p *TGetSchemasReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetSchemasReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetSchemasReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetSchemasReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TGetSchemasReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) - } - } - return err + if p.IsSetCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } + } + return err } func (p *TGetSchemasReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) - } - } - return err + if p.IsSetSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } + } + return err } func (p *TGetSchemasReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) - } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) - } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } + } + return err } func (p *TGetSchemasReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) - } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } + } + return err } func (p *TGetSchemasReq) Equals(other *TGetSchemasReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { - return false - } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { - return false - } - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { - return false - } - if p.RunAsync != other.RunAsync { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { return false } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { return false } + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } + if p.RunAsync != other.RunAsync { return false } + return true } func (p *TGetSchemasReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetSchemasReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetSchemasReq(%+v)", *p) } func (p *TGetSchemasReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetSchemasResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetSchemasResp() *TGetSchemasResp { - return &TGetSchemasResp{} + return &TGetSchemasResp{} } var TGetSchemasResp_Status_DEFAULT *TStatus - func (p *TGetSchemasResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetSchemasResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TGetSchemasResp_Status_DEFAULT + } +return p.Status } - var TGetSchemasResp_OperationHandle_DEFAULT *TOperationHandle - func (p *TGetSchemasResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetSchemasResp_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetSchemasResp_OperationHandle_DEFAULT + } +return p.OperationHandle } - var TGetSchemasResp_DirectResults_DEFAULT *TSparkDirectResults - func (p *TGetSchemasResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetSchemasResp_DirectResults_DEFAULT - } - return p.DirectResults + if !p.IsSetDirectResults() { + return TGetSchemasResp_DirectResults_DEFAULT + } +return p.DirectResults } func (p *TGetSchemasResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetSchemasResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetSchemasResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetSchemasResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TGetSchemasResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetSchemasResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetSchemasResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetSchemasResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetSchemasResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetSchemasResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetSchemasResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetSchemasResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetSchemasResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetSchemasResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TGetSchemasResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) - } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } + } + return err } func (p *TGetSchemasResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) - } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) - } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } + } + return err } func (p *TGetSchemasResp) Equals(other *TGetSchemasResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - if !p.DirectResults.Equals(other.DirectResults) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if !p.DirectResults.Equals(other.DirectResults) { return false } + return true } func (p *TGetSchemasResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetSchemasResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetSchemasResp(%+v)", *p) } func (p *TGetSchemasResp) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - CatalogName -// - SchemaName -// - TableName -// - TableTypes -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - CatalogName +// - SchemaName +// - TableName +// - TableTypes +// - GetDirectResults +// - RunAsync type TGetTablesReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - CatalogName *TPatternOrIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` - SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` - TableName *TPatternOrIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` - TableTypes []string `thrift:"tableTypes,5" db:"tableTypes" json:"tableTypes,omitempty"` - // unused fields # 6 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + CatalogName *TPatternOrIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` + TableName *TPatternOrIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` + TableTypes []string `thrift:"tableTypes,5" db:"tableTypes" json:"tableTypes,omitempty"` + // unused fields # 6 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetTablesReq() *TGetTablesReq { - return &TGetTablesReq{} + return &TGetTablesReq{} } var TGetTablesReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TGetTablesReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetTablesReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetTablesReq_SessionHandle_DEFAULT + } +return p.SessionHandle } - var TGetTablesReq_CatalogName_DEFAULT TPatternOrIdentifier - func (p *TGetTablesReq) GetCatalogName() TPatternOrIdentifier { - if !p.IsSetCatalogName() { - return TGetTablesReq_CatalogName_DEFAULT - } - return *p.CatalogName + if !p.IsSetCatalogName() { + return TGetTablesReq_CatalogName_DEFAULT + } +return *p.CatalogName } - var TGetTablesReq_SchemaName_DEFAULT TPatternOrIdentifier - func (p *TGetTablesReq) GetSchemaName() TPatternOrIdentifier { - if !p.IsSetSchemaName() { - return TGetTablesReq_SchemaName_DEFAULT - } - return *p.SchemaName + if !p.IsSetSchemaName() { + return TGetTablesReq_SchemaName_DEFAULT + } +return *p.SchemaName } - var TGetTablesReq_TableName_DEFAULT TPatternOrIdentifier - func (p *TGetTablesReq) GetTableName() TPatternOrIdentifier { - if !p.IsSetTableName() { - return TGetTablesReq_TableName_DEFAULT - } - return *p.TableName + if !p.IsSetTableName() { + return TGetTablesReq_TableName_DEFAULT + } +return *p.TableName } - var TGetTablesReq_TableTypes_DEFAULT []string func (p *TGetTablesReq) GetTableTypes() []string { - return p.TableTypes + return p.TableTypes } - var TGetTablesReq_GetDirectResults_DEFAULT *TSparkGetDirectResults - func (p *TGetTablesReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetTablesReq_GetDirectResults_DEFAULT - } - return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetTablesReq_GetDirectResults_DEFAULT + } +return p.GetDirectResults } - var TGetTablesReq_RunAsync_DEFAULT bool = false func (p *TGetTablesReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetTablesReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetTablesReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetTablesReq) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TGetTablesReq) IsSetTableName() bool { - return p.TableName != nil + return p.TableName != nil } func (p *TGetTablesReq) IsSetTableTypes() bool { - return p.TableTypes != nil + return p.TableTypes != nil } func (p *TGetTablesReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetTablesReq) IsSetRunAsync() bool { - return p.RunAsync != TGetTablesReq_RunAsync_DEFAULT + return p.RunAsync != TGetTablesReq_RunAsync_DEFAULT } func (p *TGetTablesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.LIST { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - return nil -} - -func (p *TGetTablesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetTablesReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TPatternOrIdentifier(v) - p.CatalogName = &temp - } - return nil -} - -func (p *TGetTablesReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - temp := TPatternOrIdentifier(v) - p.SchemaName = &temp - } - return nil -} - -func (p *TGetTablesReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - temp := TPatternOrIdentifier(v) - p.TableName = &temp - } - return nil -} - -func (p *TGetTablesReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]string, 0, size) - p.TableTypes = tSlice - for i := 0; i < size; i++ { - var _elem66 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem66 = v - } - p.TableTypes = append(p.TableTypes, _elem66) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TGetTablesReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetTablesReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.RunAsync = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.LIST { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + return nil +} + +func (p *TGetTablesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetTablesReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TPatternOrIdentifier(v) + p.CatalogName = &temp +} + return nil +} + +func (p *TGetTablesReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := TPatternOrIdentifier(v) + p.SchemaName = &temp +} + return nil +} + +func (p *TGetTablesReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := TPatternOrIdentifier(v) + p.TableName = &temp +} + return nil +} + +func (p *TGetTablesReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.TableTypes = tSlice + for i := 0; i < size; i ++ { +var _elem66 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem66 = v +} + p.TableTypes = append(p.TableTypes, _elem66) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TGetTablesReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetTablesReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.RunAsync = v +} + return nil } func (p *TGetTablesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTablesReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetTablesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetTablesReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TGetTablesReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) - } - } - return err + if p.IsSetCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } + } + return err } func (p *TGetTablesReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) - } - } - return err + if p.IsSetSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } + } + return err } func (p *TGetTablesReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTableName() { - if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) - } - } - return err + if p.IsSetTableName() { + if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) } + } + return err } func (p *TGetTablesReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTableTypes() { - if err := oprot.WriteFieldBegin(ctx, "tableTypes", thrift.LIST, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:tableTypes: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.TableTypes)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.TableTypes { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:tableTypes: ", p), err) - } - } - return err + if p.IsSetTableTypes() { + if err := oprot.WriteFieldBegin(ctx, "tableTypes", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:tableTypes: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.TableTypes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TableTypes { + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:tableTypes: ", p), err) } + } + return err } func (p *TGetTablesReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) - } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) - } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } + } + return err } func (p *TGetTablesReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) - } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } + } + return err } func (p *TGetTablesReq) Equals(other *TGetTablesReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { - return false - } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { - return false - } - } - if p.TableName != other.TableName { - if p.TableName == nil || other.TableName == nil { - return false - } - if (*p.TableName) != (*other.TableName) { - return false - } - } - if len(p.TableTypes) != len(other.TableTypes) { - return false - } - for i, _tgt := range p.TableTypes { - _src67 := other.TableTypes[i] - if _tgt != _src67 { - return false - } - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { - return false - } - if p.RunAsync != other.RunAsync { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { return false } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { return false } + } + if p.TableName != other.TableName { + if p.TableName == nil || other.TableName == nil { + return false + } + if (*p.TableName) != (*other.TableName) { return false } + } + if len(p.TableTypes) != len(other.TableTypes) { return false } + for i, _tgt := range p.TableTypes { + _src67 := other.TableTypes[i] + if _tgt != _src67 { return false } + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } + if p.RunAsync != other.RunAsync { return false } + return true } func (p *TGetTablesReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetTablesReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTablesReq(%+v)", *p) } func (p *TGetTablesReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetTablesResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetTablesResp() *TGetTablesResp { - return &TGetTablesResp{} + return &TGetTablesResp{} } var TGetTablesResp_Status_DEFAULT *TStatus - func (p *TGetTablesResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetTablesResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TGetTablesResp_Status_DEFAULT + } +return p.Status } - var TGetTablesResp_OperationHandle_DEFAULT *TOperationHandle - func (p *TGetTablesResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetTablesResp_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetTablesResp_OperationHandle_DEFAULT + } +return p.OperationHandle } - var TGetTablesResp_DirectResults_DEFAULT *TSparkDirectResults - func (p *TGetTablesResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetTablesResp_DirectResults_DEFAULT - } - return p.DirectResults + if !p.IsSetDirectResults() { + return TGetTablesResp_DirectResults_DEFAULT + } +return p.DirectResults } func (p *TGetTablesResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetTablesResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetTablesResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetTablesResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TGetTablesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetTablesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetTablesResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetTablesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetTablesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetTablesResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetTablesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTablesResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetTablesResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetTablesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TGetTablesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) - } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } + } + return err } func (p *TGetTablesResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) - } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) - } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } + } + return err } func (p *TGetTablesResp) Equals(other *TGetTablesResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - if !p.DirectResults.Equals(other.DirectResults) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if !p.DirectResults.Equals(other.DirectResults) { return false } + return true } func (p *TGetTablesResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetTablesResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTablesResp(%+v)", *p) } func (p *TGetTablesResp) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - GetDirectResults +// - RunAsync type TGetTableTypesReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - // unused fields # 2 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + // unused fields # 2 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetTableTypesReq() *TGetTableTypesReq { - return &TGetTableTypesReq{} + return &TGetTableTypesReq{} } var TGetTableTypesReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TGetTableTypesReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetTableTypesReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetTableTypesReq_SessionHandle_DEFAULT + } +return p.SessionHandle } - var TGetTableTypesReq_GetDirectResults_DEFAULT *TSparkGetDirectResults - func (p *TGetTableTypesReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetTableTypesReq_GetDirectResults_DEFAULT - } - return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetTableTypesReq_GetDirectResults_DEFAULT + } +return p.GetDirectResults } - var TGetTableTypesReq_RunAsync_DEFAULT bool = false func (p *TGetTableTypesReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetTableTypesReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetTableTypesReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetTableTypesReq) IsSetRunAsync() bool { - return p.RunAsync != TGetTableTypesReq_RunAsync_DEFAULT + return p.RunAsync != TGetTableTypesReq_RunAsync_DEFAULT } func (p *TGetTableTypesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - return nil -} - -func (p *TGetTableTypesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetTableTypesReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetTableTypesReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.RunAsync = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + return nil +} + +func (p *TGetTableTypesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetTableTypesReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetTableTypesReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.RunAsync = v +} + return nil } func (p *TGetTableTypesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTableTypesReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetTableTypesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetTableTypesReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TGetTableTypesReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) - } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) - } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } + } + return err } func (p *TGetTableTypesReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) - } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } + } + return err } func (p *TGetTableTypesReq) Equals(other *TGetTableTypesReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { - return false - } - if p.RunAsync != other.RunAsync { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } + if p.RunAsync != other.RunAsync { return false } + return true } func (p *TGetTableTypesReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetTableTypesReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTableTypesReq(%+v)", *p) } func (p *TGetTableTypesReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetTableTypesResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetTableTypesResp() *TGetTableTypesResp { - return &TGetTableTypesResp{} + return &TGetTableTypesResp{} } var TGetTableTypesResp_Status_DEFAULT *TStatus - func (p *TGetTableTypesResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetTableTypesResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TGetTableTypesResp_Status_DEFAULT + } +return p.Status } - var TGetTableTypesResp_OperationHandle_DEFAULT *TOperationHandle - func (p *TGetTableTypesResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetTableTypesResp_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetTableTypesResp_OperationHandle_DEFAULT + } +return p.OperationHandle } - var TGetTableTypesResp_DirectResults_DEFAULT *TSparkDirectResults - func (p *TGetTableTypesResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetTableTypesResp_DirectResults_DEFAULT - } - return p.DirectResults + if !p.IsSetDirectResults() { + return TGetTableTypesResp_DirectResults_DEFAULT + } +return p.DirectResults } func (p *TGetTableTypesResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetTableTypesResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetTableTypesResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetTableTypesResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TGetTableTypesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetTableTypesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetTableTypesResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetTableTypesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetTableTypesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetTableTypesResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetTableTypesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetTableTypesResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetTableTypesResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetTableTypesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TGetTableTypesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) - } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } + } + return err } func (p *TGetTableTypesResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) - } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) - } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } + } + return err } func (p *TGetTableTypesResp) Equals(other *TGetTableTypesResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - if !p.DirectResults.Equals(other.DirectResults) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if !p.DirectResults.Equals(other.DirectResults) { return false } + return true } func (p *TGetTableTypesResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetTableTypesResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetTableTypesResp(%+v)", *p) } func (p *TGetTableTypesResp) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - CatalogName -// - SchemaName -// - TableName -// - ColumnName -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - CatalogName +// - SchemaName +// - TableName +// - ColumnName +// - GetDirectResults +// - RunAsync type TGetColumnsReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` - SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` - TableName *TPatternOrIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` - ColumnName *TPatternOrIdentifier `thrift:"columnName,5" db:"columnName" json:"columnName,omitempty"` - // unused fields # 6 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` + TableName *TPatternOrIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` + ColumnName *TPatternOrIdentifier `thrift:"columnName,5" db:"columnName" json:"columnName,omitempty"` + // unused fields # 6 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetColumnsReq() *TGetColumnsReq { - return &TGetColumnsReq{} + return &TGetColumnsReq{} } var TGetColumnsReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TGetColumnsReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetColumnsReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetColumnsReq_SessionHandle_DEFAULT + } +return p.SessionHandle } - var TGetColumnsReq_CatalogName_DEFAULT TIdentifier - func (p *TGetColumnsReq) GetCatalogName() TIdentifier { - if !p.IsSetCatalogName() { - return TGetColumnsReq_CatalogName_DEFAULT - } - return *p.CatalogName + if !p.IsSetCatalogName() { + return TGetColumnsReq_CatalogName_DEFAULT + } +return *p.CatalogName } - var TGetColumnsReq_SchemaName_DEFAULT TPatternOrIdentifier - func (p *TGetColumnsReq) GetSchemaName() TPatternOrIdentifier { - if !p.IsSetSchemaName() { - return TGetColumnsReq_SchemaName_DEFAULT - } - return *p.SchemaName + if !p.IsSetSchemaName() { + return TGetColumnsReq_SchemaName_DEFAULT + } +return *p.SchemaName } - var TGetColumnsReq_TableName_DEFAULT TPatternOrIdentifier - func (p *TGetColumnsReq) GetTableName() TPatternOrIdentifier { - if !p.IsSetTableName() { - return TGetColumnsReq_TableName_DEFAULT - } - return *p.TableName + if !p.IsSetTableName() { + return TGetColumnsReq_TableName_DEFAULT + } +return *p.TableName } - var TGetColumnsReq_ColumnName_DEFAULT TPatternOrIdentifier - func (p *TGetColumnsReq) GetColumnName() TPatternOrIdentifier { - if !p.IsSetColumnName() { - return TGetColumnsReq_ColumnName_DEFAULT - } - return *p.ColumnName + if !p.IsSetColumnName() { + return TGetColumnsReq_ColumnName_DEFAULT + } +return *p.ColumnName } - var TGetColumnsReq_GetDirectResults_DEFAULT *TSparkGetDirectResults - func (p *TGetColumnsReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetColumnsReq_GetDirectResults_DEFAULT - } - return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetColumnsReq_GetDirectResults_DEFAULT + } +return p.GetDirectResults } - var TGetColumnsReq_RunAsync_DEFAULT bool = false func (p *TGetColumnsReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetColumnsReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetColumnsReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetColumnsReq) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TGetColumnsReq) IsSetTableName() bool { - return p.TableName != nil + return p.TableName != nil } func (p *TGetColumnsReq) IsSetColumnName() bool { - return p.ColumnName != nil + return p.ColumnName != nil } func (p *TGetColumnsReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetColumnsReq) IsSetRunAsync() bool { - return p.RunAsync != TGetColumnsReq_RunAsync_DEFAULT + return p.RunAsync != TGetColumnsReq_RunAsync_DEFAULT } func (p *TGetColumnsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - return nil -} - -func (p *TGetColumnsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetColumnsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TIdentifier(v) - p.CatalogName = &temp - } - return nil -} - -func (p *TGetColumnsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - temp := TPatternOrIdentifier(v) - p.SchemaName = &temp - } - return nil -} - -func (p *TGetColumnsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - temp := TPatternOrIdentifier(v) - p.TableName = &temp - } - return nil -} - -func (p *TGetColumnsReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - temp := TPatternOrIdentifier(v) - p.ColumnName = &temp - } - return nil -} - -func (p *TGetColumnsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetColumnsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.RunAsync = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + return nil +} + +func (p *TGetColumnsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetColumnsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TIdentifier(v) + p.CatalogName = &temp +} + return nil +} + +func (p *TGetColumnsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := TPatternOrIdentifier(v) + p.SchemaName = &temp +} + return nil +} + +func (p *TGetColumnsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := TPatternOrIdentifier(v) + p.TableName = &temp +} + return nil +} + +func (p *TGetColumnsReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := TPatternOrIdentifier(v) + p.ColumnName = &temp +} + return nil +} + +func (p *TGetColumnsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetColumnsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.RunAsync = v +} + return nil } func (p *TGetColumnsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetColumnsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetColumnsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetColumnsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TGetColumnsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) - } - } - return err + if p.IsSetCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } + } + return err } func (p *TGetColumnsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) - } - } - return err + if p.IsSetSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } + } + return err } func (p *TGetColumnsReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTableName() { - if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) - } - } - return err + if p.IsSetTableName() { + if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) } + } + return err } func (p *TGetColumnsReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetColumnName() { - if err := oprot.WriteFieldBegin(ctx, "columnName", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.ColumnName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.columnName (5) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnName: ", p), err) - } - } - return err + if p.IsSetColumnName() { + if err := oprot.WriteFieldBegin(ctx, "columnName", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ColumnName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.columnName (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnName: ", p), err) } + } + return err } func (p *TGetColumnsReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) - } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) - } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } + } + return err } func (p *TGetColumnsReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) - } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } + } + return err } func (p *TGetColumnsReq) Equals(other *TGetColumnsReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { - return false - } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { - return false - } - } - if p.TableName != other.TableName { - if p.TableName == nil || other.TableName == nil { - return false - } - if (*p.TableName) != (*other.TableName) { - return false - } - } - if p.ColumnName != other.ColumnName { - if p.ColumnName == nil || other.ColumnName == nil { - return false - } - if (*p.ColumnName) != (*other.ColumnName) { - return false - } - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { - return false - } - if p.RunAsync != other.RunAsync { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { return false } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { return false } + } + if p.TableName != other.TableName { + if p.TableName == nil || other.TableName == nil { + return false + } + if (*p.TableName) != (*other.TableName) { return false } + } + if p.ColumnName != other.ColumnName { + if p.ColumnName == nil || other.ColumnName == nil { + return false + } + if (*p.ColumnName) != (*other.ColumnName) { return false } + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } + if p.RunAsync != other.RunAsync { return false } + return true } func (p *TGetColumnsReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetColumnsReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetColumnsReq(%+v)", *p) } func (p *TGetColumnsReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetColumnsResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetColumnsResp() *TGetColumnsResp { - return &TGetColumnsResp{} + return &TGetColumnsResp{} } var TGetColumnsResp_Status_DEFAULT *TStatus - func (p *TGetColumnsResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetColumnsResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TGetColumnsResp_Status_DEFAULT + } +return p.Status } - var TGetColumnsResp_OperationHandle_DEFAULT *TOperationHandle - func (p *TGetColumnsResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetColumnsResp_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetColumnsResp_OperationHandle_DEFAULT + } +return p.OperationHandle } - var TGetColumnsResp_DirectResults_DEFAULT *TSparkDirectResults - func (p *TGetColumnsResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetColumnsResp_DirectResults_DEFAULT - } - return p.DirectResults + if !p.IsSetDirectResults() { + return TGetColumnsResp_DirectResults_DEFAULT + } +return p.DirectResults } func (p *TGetColumnsResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetColumnsResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetColumnsResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetColumnsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TGetColumnsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetColumnsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetColumnsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetColumnsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetColumnsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetColumnsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetColumnsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetColumnsResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetColumnsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetColumnsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TGetColumnsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) - } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } + } + return err } func (p *TGetColumnsResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) - } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) - } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } + } + return err } func (p *TGetColumnsResp) Equals(other *TGetColumnsResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - if !p.DirectResults.Equals(other.DirectResults) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if !p.DirectResults.Equals(other.DirectResults) { return false } + return true } func (p *TGetColumnsResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetColumnsResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetColumnsResp(%+v)", *p) } func (p *TGetColumnsResp) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - CatalogName -// - SchemaName -// - FunctionName -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - CatalogName +// - SchemaName +// - FunctionName +// - GetDirectResults +// - RunAsync type TGetFunctionsReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` - SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` - FunctionName TPatternOrIdentifier `thrift:"functionName,4,required" db:"functionName" json:"functionName"` - // unused fields # 5 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TPatternOrIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` + FunctionName TPatternOrIdentifier `thrift:"functionName,4,required" db:"functionName" json:"functionName"` + // unused fields # 5 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetFunctionsReq() *TGetFunctionsReq { - return &TGetFunctionsReq{} + return &TGetFunctionsReq{} } var TGetFunctionsReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TGetFunctionsReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetFunctionsReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetFunctionsReq_SessionHandle_DEFAULT + } +return p.SessionHandle } - var TGetFunctionsReq_CatalogName_DEFAULT TIdentifier - func (p *TGetFunctionsReq) GetCatalogName() TIdentifier { - if !p.IsSetCatalogName() { - return TGetFunctionsReq_CatalogName_DEFAULT - } - return *p.CatalogName + if !p.IsSetCatalogName() { + return TGetFunctionsReq_CatalogName_DEFAULT + } +return *p.CatalogName } - var TGetFunctionsReq_SchemaName_DEFAULT TPatternOrIdentifier - func (p *TGetFunctionsReq) GetSchemaName() TPatternOrIdentifier { - if !p.IsSetSchemaName() { - return TGetFunctionsReq_SchemaName_DEFAULT - } - return *p.SchemaName + if !p.IsSetSchemaName() { + return TGetFunctionsReq_SchemaName_DEFAULT + } +return *p.SchemaName } func (p *TGetFunctionsReq) GetFunctionName() TPatternOrIdentifier { - return p.FunctionName + return p.FunctionName } - var TGetFunctionsReq_GetDirectResults_DEFAULT *TSparkGetDirectResults - func (p *TGetFunctionsReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetFunctionsReq_GetDirectResults_DEFAULT - } - return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetFunctionsReq_GetDirectResults_DEFAULT + } +return p.GetDirectResults } - var TGetFunctionsReq_RunAsync_DEFAULT bool = false func (p *TGetFunctionsReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetFunctionsReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetFunctionsReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetFunctionsReq) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TGetFunctionsReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetFunctionsReq) IsSetRunAsync() bool { - return p.RunAsync != TGetFunctionsReq_RunAsync_DEFAULT + return p.RunAsync != TGetFunctionsReq_RunAsync_DEFAULT } func (p *TGetFunctionsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - var issetFunctionName bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - issetFunctionName = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - if !issetFunctionName { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FunctionName is not set")) - } - return nil -} - -func (p *TGetFunctionsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetFunctionsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TIdentifier(v) - p.CatalogName = &temp - } - return nil -} - -func (p *TGetFunctionsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - temp := TPatternOrIdentifier(v) - p.SchemaName = &temp - } - return nil -} - -func (p *TGetFunctionsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - temp := TPatternOrIdentifier(v) - p.FunctionName = temp - } - return nil -} - -func (p *TGetFunctionsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetFunctionsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.RunAsync = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + var issetFunctionName bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + issetFunctionName = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + if !issetFunctionName{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FunctionName is not set")); + } + return nil +} + +func (p *TGetFunctionsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetFunctionsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TIdentifier(v) + p.CatalogName = &temp +} + return nil +} + +func (p *TGetFunctionsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := TPatternOrIdentifier(v) + p.SchemaName = &temp +} + return nil +} + +func (p *TGetFunctionsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := TPatternOrIdentifier(v) + p.FunctionName = temp +} + return nil +} + +func (p *TGetFunctionsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetFunctionsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.RunAsync = v +} + return nil } func (p *TGetFunctionsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetFunctionsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetFunctionsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetFunctionsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TGetFunctionsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) - } - } - return err + if p.IsSetCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } + } + return err } func (p *TGetFunctionsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) - } - } - return err + if p.IsSetSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } + } + return err } func (p *TGetFunctionsReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "functionName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:functionName: ", p), err) - } - if err := oprot.WriteString(ctx, string(p.FunctionName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.functionName (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:functionName: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "functionName", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:functionName: ", p), err) } + if err := oprot.WriteString(ctx, string(p.FunctionName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.functionName (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:functionName: ", p), err) } + return err } func (p *TGetFunctionsReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) - } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) - } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } + } + return err } func (p *TGetFunctionsReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) - } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } + } + return err } func (p *TGetFunctionsReq) Equals(other *TGetFunctionsReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { - return false - } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { - return false - } - } - if p.FunctionName != other.FunctionName { - return false - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { - return false - } - if p.RunAsync != other.RunAsync { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { return false } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { return false } + } + if p.FunctionName != other.FunctionName { return false } + if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } + if p.RunAsync != other.RunAsync { return false } + return true } func (p *TGetFunctionsReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetFunctionsReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetFunctionsReq(%+v)", *p) } func (p *TGetFunctionsReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetFunctionsResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetFunctionsResp() *TGetFunctionsResp { - return &TGetFunctionsResp{} + return &TGetFunctionsResp{} } var TGetFunctionsResp_Status_DEFAULT *TStatus - func (p *TGetFunctionsResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetFunctionsResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TGetFunctionsResp_Status_DEFAULT + } +return p.Status } - var TGetFunctionsResp_OperationHandle_DEFAULT *TOperationHandle - func (p *TGetFunctionsResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetFunctionsResp_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetFunctionsResp_OperationHandle_DEFAULT + } +return p.OperationHandle } - var TGetFunctionsResp_DirectResults_DEFAULT *TSparkDirectResults - func (p *TGetFunctionsResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetFunctionsResp_DirectResults_DEFAULT - } - return p.DirectResults + if !p.IsSetDirectResults() { + return TGetFunctionsResp_DirectResults_DEFAULT + } +return p.DirectResults } func (p *TGetFunctionsResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetFunctionsResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetFunctionsResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetFunctionsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TGetFunctionsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetFunctionsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetFunctionsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetFunctionsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetFunctionsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetFunctionsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetFunctionsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetFunctionsResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetFunctionsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetFunctionsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TGetFunctionsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) - } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } + } + return err } func (p *TGetFunctionsResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) - } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) - } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } + } + return err } func (p *TGetFunctionsResp) Equals(other *TGetFunctionsResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - if !p.DirectResults.Equals(other.DirectResults) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if !p.DirectResults.Equals(other.DirectResults) { return false } + return true } func (p *TGetFunctionsResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetFunctionsResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetFunctionsResp(%+v)", *p) } func (p *TGetFunctionsResp) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - CatalogName -// - SchemaName -// - TableName -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - CatalogName +// - SchemaName +// - TableName +// - GetDirectResults +// - RunAsync type TGetPrimaryKeysReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` - SchemaName *TIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` - TableName *TIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` - // unused fields # 5 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` + TableName *TIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` + // unused fields # 5 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetPrimaryKeysReq() *TGetPrimaryKeysReq { - return &TGetPrimaryKeysReq{} + return &TGetPrimaryKeysReq{} } var TGetPrimaryKeysReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TGetPrimaryKeysReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetPrimaryKeysReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetPrimaryKeysReq_SessionHandle_DEFAULT + } +return p.SessionHandle } - var TGetPrimaryKeysReq_CatalogName_DEFAULT TIdentifier - func (p *TGetPrimaryKeysReq) GetCatalogName() TIdentifier { - if !p.IsSetCatalogName() { - return TGetPrimaryKeysReq_CatalogName_DEFAULT - } - return *p.CatalogName + if !p.IsSetCatalogName() { + return TGetPrimaryKeysReq_CatalogName_DEFAULT + } +return *p.CatalogName } - var TGetPrimaryKeysReq_SchemaName_DEFAULT TIdentifier - func (p *TGetPrimaryKeysReq) GetSchemaName() TIdentifier { - if !p.IsSetSchemaName() { - return TGetPrimaryKeysReq_SchemaName_DEFAULT - } - return *p.SchemaName + if !p.IsSetSchemaName() { + return TGetPrimaryKeysReq_SchemaName_DEFAULT + } +return *p.SchemaName } - var TGetPrimaryKeysReq_TableName_DEFAULT TIdentifier - func (p *TGetPrimaryKeysReq) GetTableName() TIdentifier { - if !p.IsSetTableName() { - return TGetPrimaryKeysReq_TableName_DEFAULT - } - return *p.TableName + if !p.IsSetTableName() { + return TGetPrimaryKeysReq_TableName_DEFAULT + } +return *p.TableName } - var TGetPrimaryKeysReq_GetDirectResults_DEFAULT *TSparkGetDirectResults - func (p *TGetPrimaryKeysReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetPrimaryKeysReq_GetDirectResults_DEFAULT - } - return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetPrimaryKeysReq_GetDirectResults_DEFAULT + } +return p.GetDirectResults } - var TGetPrimaryKeysReq_RunAsync_DEFAULT bool = false func (p *TGetPrimaryKeysReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetPrimaryKeysReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetPrimaryKeysReq) IsSetCatalogName() bool { - return p.CatalogName != nil + return p.CatalogName != nil } func (p *TGetPrimaryKeysReq) IsSetSchemaName() bool { - return p.SchemaName != nil + return p.SchemaName != nil } func (p *TGetPrimaryKeysReq) IsSetTableName() bool { - return p.TableName != nil + return p.TableName != nil } func (p *TGetPrimaryKeysReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetPrimaryKeysReq) IsSetRunAsync() bool { - return p.RunAsync != TGetPrimaryKeysReq_RunAsync_DEFAULT + return p.RunAsync != TGetPrimaryKeysReq_RunAsync_DEFAULT } func (p *TGetPrimaryKeysReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TIdentifier(v) - p.CatalogName = &temp - } - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - temp := TIdentifier(v) - p.SchemaName = &temp - } - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - temp := TIdentifier(v) - p.TableName = &temp - } - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetPrimaryKeysReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.RunAsync = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + return nil +} + +func (p *TGetPrimaryKeysReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetPrimaryKeysReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TIdentifier(v) + p.CatalogName = &temp +} + return nil +} + +func (p *TGetPrimaryKeysReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := TIdentifier(v) + p.SchemaName = &temp +} + return nil +} + +func (p *TGetPrimaryKeysReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := TIdentifier(v) + p.TableName = &temp +} + return nil +} + +func (p *TGetPrimaryKeysReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetPrimaryKeysReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.RunAsync = v +} + return nil } func (p *TGetPrimaryKeysReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetPrimaryKeysReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetPrimaryKeysReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetPrimaryKeysReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TGetPrimaryKeysReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) - } - } - return err + if p.IsSetCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } + } + return err } func (p *TGetPrimaryKeysReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) - } - } - return err + if p.IsSetSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } + } + return err } func (p *TGetPrimaryKeysReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTableName() { - if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) - } - } - return err + if p.IsSetTableName() { + if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) } + } + return err } func (p *TGetPrimaryKeysReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) - } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) - } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } + } + return err } func (p *TGetPrimaryKeysReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) - } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } + } + return err } func (p *TGetPrimaryKeysReq) Equals(other *TGetPrimaryKeysReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if p.CatalogName != other.CatalogName { - if p.CatalogName == nil || other.CatalogName == nil { - return false - } - if (*p.CatalogName) != (*other.CatalogName) { - return false - } - } - if p.SchemaName != other.SchemaName { - if p.SchemaName == nil || other.SchemaName == nil { - return false - } - if (*p.SchemaName) != (*other.SchemaName) { - return false - } - } - if p.TableName != other.TableName { - if p.TableName == nil || other.TableName == nil { - return false - } - if (*p.TableName) != (*other.TableName) { - return false - } - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { - return false - } - if p.RunAsync != other.RunAsync { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { return false } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { return false } + } + if p.TableName != other.TableName { + if p.TableName == nil || other.TableName == nil { + return false + } + if (*p.TableName) != (*other.TableName) { return false } + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } + if p.RunAsync != other.RunAsync { return false } + return true } func (p *TGetPrimaryKeysReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetPrimaryKeysReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetPrimaryKeysReq(%+v)", *p) } func (p *TGetPrimaryKeysReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetPrimaryKeysResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetPrimaryKeysResp() *TGetPrimaryKeysResp { - return &TGetPrimaryKeysResp{} + return &TGetPrimaryKeysResp{} } var TGetPrimaryKeysResp_Status_DEFAULT *TStatus - func (p *TGetPrimaryKeysResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetPrimaryKeysResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TGetPrimaryKeysResp_Status_DEFAULT + } +return p.Status } - var TGetPrimaryKeysResp_OperationHandle_DEFAULT *TOperationHandle - func (p *TGetPrimaryKeysResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetPrimaryKeysResp_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetPrimaryKeysResp_OperationHandle_DEFAULT + } +return p.OperationHandle } - var TGetPrimaryKeysResp_DirectResults_DEFAULT *TSparkDirectResults - func (p *TGetPrimaryKeysResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetPrimaryKeysResp_DirectResults_DEFAULT - } - return p.DirectResults + if !p.IsSetDirectResults() { + return TGetPrimaryKeysResp_DirectResults_DEFAULT + } +return p.DirectResults } func (p *TGetPrimaryKeysResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetPrimaryKeysResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetPrimaryKeysResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetPrimaryKeysResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TGetPrimaryKeysResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetPrimaryKeysResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetPrimaryKeysResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetPrimaryKeysResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetPrimaryKeysResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetPrimaryKeysResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetPrimaryKeysResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetPrimaryKeysResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetPrimaryKeysResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetPrimaryKeysResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TGetPrimaryKeysResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) - } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } + } + return err } func (p *TGetPrimaryKeysResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) - } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) - } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } + } + return err } func (p *TGetPrimaryKeysResp) Equals(other *TGetPrimaryKeysResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - if !p.DirectResults.Equals(other.DirectResults) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if !p.DirectResults.Equals(other.DirectResults) { return false } + return true } func (p *TGetPrimaryKeysResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetPrimaryKeysResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetPrimaryKeysResp(%+v)", *p) } func (p *TGetPrimaryKeysResp) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - ParentCatalogName -// - ParentSchemaName -// - ParentTableName -// - ForeignCatalogName -// - ForeignSchemaName -// - ForeignTableName -// - GetDirectResults -// - RunAsync +// - SessionHandle +// - ParentCatalogName +// - ParentSchemaName +// - ParentTableName +// - ForeignCatalogName +// - ForeignSchemaName +// - ForeignTableName +// - GetDirectResults +// - RunAsync type TGetCrossReferenceReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - ParentCatalogName *TIdentifier `thrift:"parentCatalogName,2" db:"parentCatalogName" json:"parentCatalogName,omitempty"` - ParentSchemaName *TIdentifier `thrift:"parentSchemaName,3" db:"parentSchemaName" json:"parentSchemaName,omitempty"` - ParentTableName *TIdentifier `thrift:"parentTableName,4" db:"parentTableName" json:"parentTableName,omitempty"` - ForeignCatalogName *TIdentifier `thrift:"foreignCatalogName,5" db:"foreignCatalogName" json:"foreignCatalogName,omitempty"` - ForeignSchemaName *TIdentifier `thrift:"foreignSchemaName,6" db:"foreignSchemaName" json:"foreignSchemaName,omitempty"` - ForeignTableName *TIdentifier `thrift:"foreignTableName,7" db:"foreignTableName" json:"foreignTableName,omitempty"` - // unused fields # 8 to 1280 - GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` - RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + ParentCatalogName *TIdentifier `thrift:"parentCatalogName,2" db:"parentCatalogName" json:"parentCatalogName,omitempty"` + ParentSchemaName *TIdentifier `thrift:"parentSchemaName,3" db:"parentSchemaName" json:"parentSchemaName,omitempty"` + ParentTableName *TIdentifier `thrift:"parentTableName,4" db:"parentTableName" json:"parentTableName,omitempty"` + ForeignCatalogName *TIdentifier `thrift:"foreignCatalogName,5" db:"foreignCatalogName" json:"foreignCatalogName,omitempty"` + ForeignSchemaName *TIdentifier `thrift:"foreignSchemaName,6" db:"foreignSchemaName" json:"foreignSchemaName,omitempty"` + ForeignTableName *TIdentifier `thrift:"foreignTableName,7" db:"foreignTableName" json:"foreignTableName,omitempty"` + // unused fields # 8 to 1280 + GetDirectResults *TSparkGetDirectResults `thrift:"getDirectResults,1281" db:"getDirectResults" json:"getDirectResults,omitempty"` + RunAsync bool `thrift:"runAsync,1282" db:"runAsync" json:"runAsync"` } func NewTGetCrossReferenceReq() *TGetCrossReferenceReq { - return &TGetCrossReferenceReq{} + return &TGetCrossReferenceReq{} } var TGetCrossReferenceReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TGetCrossReferenceReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetCrossReferenceReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetCrossReferenceReq_SessionHandle_DEFAULT + } +return p.SessionHandle } - var TGetCrossReferenceReq_ParentCatalogName_DEFAULT TIdentifier - func (p *TGetCrossReferenceReq) GetParentCatalogName() TIdentifier { - if !p.IsSetParentCatalogName() { - return TGetCrossReferenceReq_ParentCatalogName_DEFAULT - } - return *p.ParentCatalogName + if !p.IsSetParentCatalogName() { + return TGetCrossReferenceReq_ParentCatalogName_DEFAULT + } +return *p.ParentCatalogName } - var TGetCrossReferenceReq_ParentSchemaName_DEFAULT TIdentifier - func (p *TGetCrossReferenceReq) GetParentSchemaName() TIdentifier { - if !p.IsSetParentSchemaName() { - return TGetCrossReferenceReq_ParentSchemaName_DEFAULT - } - return *p.ParentSchemaName + if !p.IsSetParentSchemaName() { + return TGetCrossReferenceReq_ParentSchemaName_DEFAULT + } +return *p.ParentSchemaName } - var TGetCrossReferenceReq_ParentTableName_DEFAULT TIdentifier - func (p *TGetCrossReferenceReq) GetParentTableName() TIdentifier { - if !p.IsSetParentTableName() { - return TGetCrossReferenceReq_ParentTableName_DEFAULT - } - return *p.ParentTableName + if !p.IsSetParentTableName() { + return TGetCrossReferenceReq_ParentTableName_DEFAULT + } +return *p.ParentTableName } - var TGetCrossReferenceReq_ForeignCatalogName_DEFAULT TIdentifier - func (p *TGetCrossReferenceReq) GetForeignCatalogName() TIdentifier { - if !p.IsSetForeignCatalogName() { - return TGetCrossReferenceReq_ForeignCatalogName_DEFAULT - } - return *p.ForeignCatalogName + if !p.IsSetForeignCatalogName() { + return TGetCrossReferenceReq_ForeignCatalogName_DEFAULT + } +return *p.ForeignCatalogName } - var TGetCrossReferenceReq_ForeignSchemaName_DEFAULT TIdentifier - func (p *TGetCrossReferenceReq) GetForeignSchemaName() TIdentifier { - if !p.IsSetForeignSchemaName() { - return TGetCrossReferenceReq_ForeignSchemaName_DEFAULT - } - return *p.ForeignSchemaName + if !p.IsSetForeignSchemaName() { + return TGetCrossReferenceReq_ForeignSchemaName_DEFAULT + } +return *p.ForeignSchemaName } - var TGetCrossReferenceReq_ForeignTableName_DEFAULT TIdentifier - func (p *TGetCrossReferenceReq) GetForeignTableName() TIdentifier { - if !p.IsSetForeignTableName() { - return TGetCrossReferenceReq_ForeignTableName_DEFAULT - } - return *p.ForeignTableName + if !p.IsSetForeignTableName() { + return TGetCrossReferenceReq_ForeignTableName_DEFAULT + } +return *p.ForeignTableName } - var TGetCrossReferenceReq_GetDirectResults_DEFAULT *TSparkGetDirectResults - func (p *TGetCrossReferenceReq) GetGetDirectResults() *TSparkGetDirectResults { - if !p.IsSetGetDirectResults() { - return TGetCrossReferenceReq_GetDirectResults_DEFAULT - } - return p.GetDirectResults + if !p.IsSetGetDirectResults() { + return TGetCrossReferenceReq_GetDirectResults_DEFAULT + } +return p.GetDirectResults } - var TGetCrossReferenceReq_RunAsync_DEFAULT bool = false func (p *TGetCrossReferenceReq) GetRunAsync() bool { - return p.RunAsync + return p.RunAsync } func (p *TGetCrossReferenceReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetCrossReferenceReq) IsSetParentCatalogName() bool { - return p.ParentCatalogName != nil + return p.ParentCatalogName != nil } func (p *TGetCrossReferenceReq) IsSetParentSchemaName() bool { - return p.ParentSchemaName != nil + return p.ParentSchemaName != nil } func (p *TGetCrossReferenceReq) IsSetParentTableName() bool { - return p.ParentTableName != nil + return p.ParentTableName != nil } func (p *TGetCrossReferenceReq) IsSetForeignCatalogName() bool { - return p.ForeignCatalogName != nil + return p.ForeignCatalogName != nil } func (p *TGetCrossReferenceReq) IsSetForeignSchemaName() bool { - return p.ForeignSchemaName != nil + return p.ForeignSchemaName != nil } func (p *TGetCrossReferenceReq) IsSetForeignTableName() bool { - return p.ForeignTableName != nil + return p.ForeignTableName != nil } func (p *TGetCrossReferenceReq) IsSetGetDirectResults() bool { - return p.GetDirectResults != nil + return p.GetDirectResults != nil } func (p *TGetCrossReferenceReq) IsSetRunAsync() bool { - return p.RunAsync != TGetCrossReferenceReq_RunAsync_DEFAULT + return p.RunAsync != TGetCrossReferenceReq_RunAsync_DEFAULT } func (p *TGetCrossReferenceReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.STRING { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRING { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.STRING { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - return nil -} - -func (p *TGetCrossReferenceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetCrossReferenceReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TIdentifier(v) - p.ParentCatalogName = &temp - } - return nil -} - -func (p *TGetCrossReferenceReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - temp := TIdentifier(v) - p.ParentSchemaName = &temp - } - return nil -} - -func (p *TGetCrossReferenceReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - temp := TIdentifier(v) - p.ParentTableName = &temp - } - return nil -} - -func (p *TGetCrossReferenceReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - temp := TIdentifier(v) - p.ForeignCatalogName = &temp - } - return nil -} - -func (p *TGetCrossReferenceReq) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) - } else { - temp := TIdentifier(v) - p.ForeignSchemaName = &temp - } - return nil -} - -func (p *TGetCrossReferenceReq) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 7: ", err) - } else { - temp := TIdentifier(v) - p.ForeignTableName = &temp - } - return nil -} - -func (p *TGetCrossReferenceReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.GetDirectResults = &TSparkGetDirectResults{} - if err := p.GetDirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) - } - return nil -} - -func (p *TGetCrossReferenceReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.RunAsync = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TIdentifier(v) + p.ParentCatalogName = &temp +} + return nil +} + +func (p *TGetCrossReferenceReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := TIdentifier(v) + p.ParentSchemaName = &temp +} + return nil +} + +func (p *TGetCrossReferenceReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := TIdentifier(v) + p.ParentTableName = &temp +} + return nil +} + +func (p *TGetCrossReferenceReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := TIdentifier(v) + p.ForeignCatalogName = &temp +} + return nil +} + +func (p *TGetCrossReferenceReq) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + temp := TIdentifier(v) + p.ForeignSchemaName = &temp +} + return nil +} + +func (p *TGetCrossReferenceReq) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + temp := TIdentifier(v) + p.ForeignTableName = &temp +} + return nil +} + +func (p *TGetCrossReferenceReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.GetDirectResults = &TSparkGetDirectResults{} + if err := p.GetDirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetDirectResults), err) + } + return nil +} + +func (p *TGetCrossReferenceReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.RunAsync = v +} + return nil } func (p *TGetCrossReferenceReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetCrossReferenceReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - if err := p.writeField6(ctx, oprot); err != nil { - return err - } - if err := p.writeField7(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetCrossReferenceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetCrossReferenceReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TGetCrossReferenceReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetParentCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "parentCatalogName", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parentCatalogName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.ParentCatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.parentCatalogName (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parentCatalogName: ", p), err) - } - } - return err + if p.IsSetParentCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "parentCatalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parentCatalogName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ParentCatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parentCatalogName (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parentCatalogName: ", p), err) } + } + return err } func (p *TGetCrossReferenceReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetParentSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "parentSchemaName", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parentSchemaName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.ParentSchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.parentSchemaName (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parentSchemaName: ", p), err) - } - } - return err + if p.IsSetParentSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "parentSchemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parentSchemaName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ParentSchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parentSchemaName (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parentSchemaName: ", p), err) } + } + return err } func (p *TGetCrossReferenceReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetParentTableName() { - if err := oprot.WriteFieldBegin(ctx, "parentTableName", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:parentTableName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.ParentTableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.parentTableName (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:parentTableName: ", p), err) - } - } - return err + if p.IsSetParentTableName() { + if err := oprot.WriteFieldBegin(ctx, "parentTableName", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:parentTableName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ParentTableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parentTableName (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:parentTableName: ", p), err) } + } + return err } func (p *TGetCrossReferenceReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetForeignCatalogName() { - if err := oprot.WriteFieldBegin(ctx, "foreignCatalogName", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:foreignCatalogName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.ForeignCatalogName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.foreignCatalogName (5) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:foreignCatalogName: ", p), err) - } - } - return err + if p.IsSetForeignCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "foreignCatalogName", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:foreignCatalogName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ForeignCatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.foreignCatalogName (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:foreignCatalogName: ", p), err) } + } + return err } func (p *TGetCrossReferenceReq) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetForeignSchemaName() { - if err := oprot.WriteFieldBegin(ctx, "foreignSchemaName", thrift.STRING, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:foreignSchemaName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.ForeignSchemaName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.foreignSchemaName (6) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:foreignSchemaName: ", p), err) - } - } - return err + if p.IsSetForeignSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "foreignSchemaName", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:foreignSchemaName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ForeignSchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.foreignSchemaName (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:foreignSchemaName: ", p), err) } + } + return err } func (p *TGetCrossReferenceReq) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetForeignTableName() { - if err := oprot.WriteFieldBegin(ctx, "foreignTableName", thrift.STRING, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:foreignTableName: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.ForeignTableName)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.foreignTableName (7) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:foreignTableName: ", p), err) - } - } - return err + if p.IsSetForeignTableName() { + if err := oprot.WriteFieldBegin(ctx, "foreignTableName", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:foreignTableName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ForeignTableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.foreignTableName (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:foreignTableName: ", p), err) } + } + return err } func (p *TGetCrossReferenceReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) - } - if err := p.GetDirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) - } - } - return err + if p.IsSetGetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "getDirectResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:getDirectResults: ", p), err) } + if err := p.GetDirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetDirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:getDirectResults: ", p), err) } + } + return err } func (p *TGetCrossReferenceReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) - } - } - return err + if p.IsSetRunAsync() { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:runAsync: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.runAsync (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:runAsync: ", p), err) } + } + return err } func (p *TGetCrossReferenceReq) Equals(other *TGetCrossReferenceReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if p.ParentCatalogName != other.ParentCatalogName { - if p.ParentCatalogName == nil || other.ParentCatalogName == nil { - return false - } - if (*p.ParentCatalogName) != (*other.ParentCatalogName) { - return false - } - } - if p.ParentSchemaName != other.ParentSchemaName { - if p.ParentSchemaName == nil || other.ParentSchemaName == nil { - return false - } - if (*p.ParentSchemaName) != (*other.ParentSchemaName) { - return false - } - } - if p.ParentTableName != other.ParentTableName { - if p.ParentTableName == nil || other.ParentTableName == nil { - return false - } - if (*p.ParentTableName) != (*other.ParentTableName) { - return false - } - } - if p.ForeignCatalogName != other.ForeignCatalogName { - if p.ForeignCatalogName == nil || other.ForeignCatalogName == nil { - return false - } - if (*p.ForeignCatalogName) != (*other.ForeignCatalogName) { - return false - } - } - if p.ForeignSchemaName != other.ForeignSchemaName { - if p.ForeignSchemaName == nil || other.ForeignSchemaName == nil { - return false - } - if (*p.ForeignSchemaName) != (*other.ForeignSchemaName) { - return false - } - } - if p.ForeignTableName != other.ForeignTableName { - if p.ForeignTableName == nil || other.ForeignTableName == nil { - return false - } - if (*p.ForeignTableName) != (*other.ForeignTableName) { - return false - } - } - if !p.GetDirectResults.Equals(other.GetDirectResults) { - return false - } - if p.RunAsync != other.RunAsync { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.ParentCatalogName != other.ParentCatalogName { + if p.ParentCatalogName == nil || other.ParentCatalogName == nil { + return false + } + if (*p.ParentCatalogName) != (*other.ParentCatalogName) { return false } + } + if p.ParentSchemaName != other.ParentSchemaName { + if p.ParentSchemaName == nil || other.ParentSchemaName == nil { + return false + } + if (*p.ParentSchemaName) != (*other.ParentSchemaName) { return false } + } + if p.ParentTableName != other.ParentTableName { + if p.ParentTableName == nil || other.ParentTableName == nil { + return false + } + if (*p.ParentTableName) != (*other.ParentTableName) { return false } + } + if p.ForeignCatalogName != other.ForeignCatalogName { + if p.ForeignCatalogName == nil || other.ForeignCatalogName == nil { + return false + } + if (*p.ForeignCatalogName) != (*other.ForeignCatalogName) { return false } + } + if p.ForeignSchemaName != other.ForeignSchemaName { + if p.ForeignSchemaName == nil || other.ForeignSchemaName == nil { + return false + } + if (*p.ForeignSchemaName) != (*other.ForeignSchemaName) { return false } + } + if p.ForeignTableName != other.ForeignTableName { + if p.ForeignTableName == nil || other.ForeignTableName == nil { + return false + } + if (*p.ForeignTableName) != (*other.ForeignTableName) { return false } + } + if !p.GetDirectResults.Equals(other.GetDirectResults) { return false } + if p.RunAsync != other.RunAsync { return false } + return true } func (p *TGetCrossReferenceReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetCrossReferenceReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetCrossReferenceReq(%+v)", *p) } func (p *TGetCrossReferenceReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - OperationHandle -// - DirectResults +// - Status +// - OperationHandle +// - DirectResults type TGetCrossReferenceResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` - // unused fields # 3 to 1280 - DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` + // unused fields # 3 to 1280 + DirectResults *TSparkDirectResults `thrift:"directResults,1281" db:"directResults" json:"directResults,omitempty"` } func NewTGetCrossReferenceResp() *TGetCrossReferenceResp { - return &TGetCrossReferenceResp{} + return &TGetCrossReferenceResp{} } var TGetCrossReferenceResp_Status_DEFAULT *TStatus - func (p *TGetCrossReferenceResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetCrossReferenceResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TGetCrossReferenceResp_Status_DEFAULT + } +return p.Status } - var TGetCrossReferenceResp_OperationHandle_DEFAULT *TOperationHandle - func (p *TGetCrossReferenceResp) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetCrossReferenceResp_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetCrossReferenceResp_OperationHandle_DEFAULT + } +return p.OperationHandle } - var TGetCrossReferenceResp_DirectResults_DEFAULT *TSparkDirectResults - func (p *TGetCrossReferenceResp) GetDirectResults() *TSparkDirectResults { - if !p.IsSetDirectResults() { - return TGetCrossReferenceResp_DirectResults_DEFAULT - } - return p.DirectResults + if !p.IsSetDirectResults() { + return TGetCrossReferenceResp_DirectResults_DEFAULT + } +return p.DirectResults } func (p *TGetCrossReferenceResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetCrossReferenceResp) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetCrossReferenceResp) IsSetDirectResults() bool { - return p.DirectResults != nil + return p.DirectResults != nil } func (p *TGetCrossReferenceResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TGetCrossReferenceResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetCrossReferenceResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetCrossReferenceResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.DirectResults = &TSparkDirectResults{} - if err := p.DirectResults.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetCrossReferenceResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetCrossReferenceResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetCrossReferenceResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.DirectResults = &TSparkDirectResults{} + if err := p.DirectResults.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DirectResults), err) + } + return nil } func (p *TGetCrossReferenceResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetCrossReferenceResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetCrossReferenceResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetCrossReferenceResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TGetCrossReferenceResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) - } - } - return err + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } + } + return err } func (p *TGetCrossReferenceResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDirectResults() { - if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) - } - if err := p.DirectResults.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) - } - } - return err + if p.IsSetDirectResults() { + if err := oprot.WriteFieldBegin(ctx, "directResults", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:directResults: ", p), err) } + if err := p.DirectResults.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DirectResults), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:directResults: ", p), err) } + } + return err } func (p *TGetCrossReferenceResp) Equals(other *TGetCrossReferenceResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - if !p.DirectResults.Equals(other.DirectResults) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if !p.DirectResults.Equals(other.DirectResults) { return false } + return true } func (p *TGetCrossReferenceResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetCrossReferenceResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetCrossReferenceResp(%+v)", *p) } func (p *TGetCrossReferenceResp) Validate() error { - return nil + return nil } - // Attributes: -// - OperationHandle -// - GetProgressUpdate +// - OperationHandle +// - GetProgressUpdate type TGetOperationStatusReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` - GetProgressUpdate *bool `thrift:"getProgressUpdate,2" db:"getProgressUpdate" json:"getProgressUpdate,omitempty"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + GetProgressUpdate *bool `thrift:"getProgressUpdate,2" db:"getProgressUpdate" json:"getProgressUpdate,omitempty"` } func NewTGetOperationStatusReq() *TGetOperationStatusReq { - return &TGetOperationStatusReq{} + return &TGetOperationStatusReq{} } var TGetOperationStatusReq_OperationHandle_DEFAULT *TOperationHandle - func (p *TGetOperationStatusReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetOperationStatusReq_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetOperationStatusReq_OperationHandle_DEFAULT + } +return p.OperationHandle } - var TGetOperationStatusReq_GetProgressUpdate_DEFAULT bool - func (p *TGetOperationStatusReq) GetGetProgressUpdate() bool { - if !p.IsSetGetProgressUpdate() { - return TGetOperationStatusReq_GetProgressUpdate_DEFAULT - } - return *p.GetProgressUpdate + if !p.IsSetGetProgressUpdate() { + return TGetOperationStatusReq_GetProgressUpdate_DEFAULT + } +return *p.GetProgressUpdate } func (p *TGetOperationStatusReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetOperationStatusReq) IsSetGetProgressUpdate() bool { - return p.GetProgressUpdate != nil + return p.GetProgressUpdate != nil } func (p *TGetOperationStatusReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")) - } - return nil -} - -func (p *TGetOperationStatusReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetOperationStatusReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.GetProgressUpdate = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperationHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperationHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); + } + return nil +} + +func (p *TGetOperationStatusReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetOperationStatusReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.GetProgressUpdate = &v +} + return nil } func (p *TGetOperationStatusReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetOperationStatusReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetOperationStatusReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetOperationStatusReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } + return err } func (p *TGetOperationStatusReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetGetProgressUpdate() { - if err := oprot.WriteFieldBegin(ctx, "getProgressUpdate", thrift.BOOL, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:getProgressUpdate: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.GetProgressUpdate)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.getProgressUpdate (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:getProgressUpdate: ", p), err) - } - } - return err + if p.IsSetGetProgressUpdate() { + if err := oprot.WriteFieldBegin(ctx, "getProgressUpdate", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:getProgressUpdate: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.GetProgressUpdate)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.getProgressUpdate (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:getProgressUpdate: ", p), err) } + } + return err } func (p *TGetOperationStatusReq) Equals(other *TGetOperationStatusReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - if p.GetProgressUpdate != other.GetProgressUpdate { - if p.GetProgressUpdate == nil || other.GetProgressUpdate == nil { - return false - } - if (*p.GetProgressUpdate) != (*other.GetProgressUpdate) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if p.GetProgressUpdate != other.GetProgressUpdate { + if p.GetProgressUpdate == nil || other.GetProgressUpdate == nil { + return false + } + if (*p.GetProgressUpdate) != (*other.GetProgressUpdate) { return false } + } + return true } func (p *TGetOperationStatusReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetOperationStatusReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetOperationStatusReq(%+v)", *p) } func (p *TGetOperationStatusReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - OperationState -// - SqlState -// - ErrorCode -// - ErrorMessage -// - TaskStatus -// - OperationStarted -// - OperationCompleted -// - HasResultSet -// - ProgressUpdateResponse -// - NumModifiedRows -// - DisplayMessage -// - DiagnosticInfo -// - ErrorDetailsJson +// - Status +// - OperationState +// - SqlState +// - ErrorCode +// - ErrorMessage +// - TaskStatus +// - OperationStarted +// - OperationCompleted +// - HasResultSet +// - ProgressUpdateResponse +// - NumModifiedRows +// - DisplayMessage +// - DiagnosticInfo +// - ErrorDetailsJson type TGetOperationStatusResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationState *TOperationState `thrift:"operationState,2" db:"operationState" json:"operationState,omitempty"` - SqlState *string `thrift:"sqlState,3" db:"sqlState" json:"sqlState,omitempty"` - ErrorCode *int32 `thrift:"errorCode,4" db:"errorCode" json:"errorCode,omitempty"` - ErrorMessage *string `thrift:"errorMessage,5" db:"errorMessage" json:"errorMessage,omitempty"` - TaskStatus *string `thrift:"taskStatus,6" db:"taskStatus" json:"taskStatus,omitempty"` - OperationStarted *int64 `thrift:"operationStarted,7" db:"operationStarted" json:"operationStarted,omitempty"` - OperationCompleted *int64 `thrift:"operationCompleted,8" db:"operationCompleted" json:"operationCompleted,omitempty"` - HasResultSet *bool `thrift:"hasResultSet,9" db:"hasResultSet" json:"hasResultSet,omitempty"` - ProgressUpdateResponse *TProgressUpdateResp `thrift:"progressUpdateResponse,10" db:"progressUpdateResponse" json:"progressUpdateResponse,omitempty"` - NumModifiedRows *int64 `thrift:"numModifiedRows,11" db:"numModifiedRows" json:"numModifiedRows,omitempty"` - // unused fields # 12 to 1280 - DisplayMessage *string `thrift:"displayMessage,1281" db:"displayMessage" json:"displayMessage,omitempty"` - DiagnosticInfo *string `thrift:"diagnosticInfo,1282" db:"diagnosticInfo" json:"diagnosticInfo,omitempty"` - ErrorDetailsJson *string `thrift:"errorDetailsJson,1283" db:"errorDetailsJson" json:"errorDetailsJson,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationState *TOperationState `thrift:"operationState,2" db:"operationState" json:"operationState,omitempty"` + SqlState *string `thrift:"sqlState,3" db:"sqlState" json:"sqlState,omitempty"` + ErrorCode *int32 `thrift:"errorCode,4" db:"errorCode" json:"errorCode,omitempty"` + ErrorMessage *string `thrift:"errorMessage,5" db:"errorMessage" json:"errorMessage,omitempty"` + TaskStatus *string `thrift:"taskStatus,6" db:"taskStatus" json:"taskStatus,omitempty"` + OperationStarted *int64 `thrift:"operationStarted,7" db:"operationStarted" json:"operationStarted,omitempty"` + OperationCompleted *int64 `thrift:"operationCompleted,8" db:"operationCompleted" json:"operationCompleted,omitempty"` + HasResultSet *bool `thrift:"hasResultSet,9" db:"hasResultSet" json:"hasResultSet,omitempty"` + ProgressUpdateResponse *TProgressUpdateResp `thrift:"progressUpdateResponse,10" db:"progressUpdateResponse" json:"progressUpdateResponse,omitempty"` + NumModifiedRows *int64 `thrift:"numModifiedRows,11" db:"numModifiedRows" json:"numModifiedRows,omitempty"` + // unused fields # 12 to 1280 + DisplayMessage *string `thrift:"displayMessage,1281" db:"displayMessage" json:"displayMessage,omitempty"` + DiagnosticInfo *string `thrift:"diagnosticInfo,1282" db:"diagnosticInfo" json:"diagnosticInfo,omitempty"` + ErrorDetailsJson *string `thrift:"errorDetailsJson,1283" db:"errorDetailsJson" json:"errorDetailsJson,omitempty"` } func NewTGetOperationStatusResp() *TGetOperationStatusResp { - return &TGetOperationStatusResp{} + return &TGetOperationStatusResp{} } var TGetOperationStatusResp_Status_DEFAULT *TStatus - func (p *TGetOperationStatusResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetOperationStatusResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TGetOperationStatusResp_Status_DEFAULT + } +return p.Status } - var TGetOperationStatusResp_OperationState_DEFAULT TOperationState - func (p *TGetOperationStatusResp) GetOperationState() TOperationState { - if !p.IsSetOperationState() { - return TGetOperationStatusResp_OperationState_DEFAULT - } - return *p.OperationState + if !p.IsSetOperationState() { + return TGetOperationStatusResp_OperationState_DEFAULT + } +return *p.OperationState } - var TGetOperationStatusResp_SqlState_DEFAULT string - func (p *TGetOperationStatusResp) GetSqlState() string { - if !p.IsSetSqlState() { - return TGetOperationStatusResp_SqlState_DEFAULT - } - return *p.SqlState + if !p.IsSetSqlState() { + return TGetOperationStatusResp_SqlState_DEFAULT + } +return *p.SqlState } - var TGetOperationStatusResp_ErrorCode_DEFAULT int32 - func (p *TGetOperationStatusResp) GetErrorCode() int32 { - if !p.IsSetErrorCode() { - return TGetOperationStatusResp_ErrorCode_DEFAULT - } - return *p.ErrorCode + if !p.IsSetErrorCode() { + return TGetOperationStatusResp_ErrorCode_DEFAULT + } +return *p.ErrorCode } - var TGetOperationStatusResp_ErrorMessage_DEFAULT string - func (p *TGetOperationStatusResp) GetErrorMessage() string { - if !p.IsSetErrorMessage() { - return TGetOperationStatusResp_ErrorMessage_DEFAULT - } - return *p.ErrorMessage + if !p.IsSetErrorMessage() { + return TGetOperationStatusResp_ErrorMessage_DEFAULT + } +return *p.ErrorMessage } - var TGetOperationStatusResp_TaskStatus_DEFAULT string - func (p *TGetOperationStatusResp) GetTaskStatus() string { - if !p.IsSetTaskStatus() { - return TGetOperationStatusResp_TaskStatus_DEFAULT - } - return *p.TaskStatus + if !p.IsSetTaskStatus() { + return TGetOperationStatusResp_TaskStatus_DEFAULT + } +return *p.TaskStatus } - var TGetOperationStatusResp_OperationStarted_DEFAULT int64 - func (p *TGetOperationStatusResp) GetOperationStarted() int64 { - if !p.IsSetOperationStarted() { - return TGetOperationStatusResp_OperationStarted_DEFAULT - } - return *p.OperationStarted + if !p.IsSetOperationStarted() { + return TGetOperationStatusResp_OperationStarted_DEFAULT + } +return *p.OperationStarted } - var TGetOperationStatusResp_OperationCompleted_DEFAULT int64 - func (p *TGetOperationStatusResp) GetOperationCompleted() int64 { - if !p.IsSetOperationCompleted() { - return TGetOperationStatusResp_OperationCompleted_DEFAULT - } - return *p.OperationCompleted + if !p.IsSetOperationCompleted() { + return TGetOperationStatusResp_OperationCompleted_DEFAULT + } +return *p.OperationCompleted } - var TGetOperationStatusResp_HasResultSet_DEFAULT bool - func (p *TGetOperationStatusResp) GetHasResultSet() bool { - if !p.IsSetHasResultSet() { - return TGetOperationStatusResp_HasResultSet_DEFAULT - } - return *p.HasResultSet + if !p.IsSetHasResultSet() { + return TGetOperationStatusResp_HasResultSet_DEFAULT + } +return *p.HasResultSet } - var TGetOperationStatusResp_ProgressUpdateResponse_DEFAULT *TProgressUpdateResp - func (p *TGetOperationStatusResp) GetProgressUpdateResponse() *TProgressUpdateResp { - if !p.IsSetProgressUpdateResponse() { - return TGetOperationStatusResp_ProgressUpdateResponse_DEFAULT - } - return p.ProgressUpdateResponse + if !p.IsSetProgressUpdateResponse() { + return TGetOperationStatusResp_ProgressUpdateResponse_DEFAULT + } +return p.ProgressUpdateResponse } - var TGetOperationStatusResp_NumModifiedRows_DEFAULT int64 - func (p *TGetOperationStatusResp) GetNumModifiedRows() int64 { - if !p.IsSetNumModifiedRows() { - return TGetOperationStatusResp_NumModifiedRows_DEFAULT - } - return *p.NumModifiedRows + if !p.IsSetNumModifiedRows() { + return TGetOperationStatusResp_NumModifiedRows_DEFAULT + } +return *p.NumModifiedRows } - var TGetOperationStatusResp_DisplayMessage_DEFAULT string - func (p *TGetOperationStatusResp) GetDisplayMessage() string { - if !p.IsSetDisplayMessage() { - return TGetOperationStatusResp_DisplayMessage_DEFAULT - } - return *p.DisplayMessage + if !p.IsSetDisplayMessage() { + return TGetOperationStatusResp_DisplayMessage_DEFAULT + } +return *p.DisplayMessage } - var TGetOperationStatusResp_DiagnosticInfo_DEFAULT string - func (p *TGetOperationStatusResp) GetDiagnosticInfo() string { - if !p.IsSetDiagnosticInfo() { - return TGetOperationStatusResp_DiagnosticInfo_DEFAULT - } - return *p.DiagnosticInfo + if !p.IsSetDiagnosticInfo() { + return TGetOperationStatusResp_DiagnosticInfo_DEFAULT + } +return *p.DiagnosticInfo } - var TGetOperationStatusResp_ErrorDetailsJson_DEFAULT string - func (p *TGetOperationStatusResp) GetErrorDetailsJson() string { - if !p.IsSetErrorDetailsJson() { - return TGetOperationStatusResp_ErrorDetailsJson_DEFAULT - } - return *p.ErrorDetailsJson + if !p.IsSetErrorDetailsJson() { + return TGetOperationStatusResp_ErrorDetailsJson_DEFAULT + } +return *p.ErrorDetailsJson } func (p *TGetOperationStatusResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetOperationStatusResp) IsSetOperationState() bool { - return p.OperationState != nil + return p.OperationState != nil } func (p *TGetOperationStatusResp) IsSetSqlState() bool { - return p.SqlState != nil + return p.SqlState != nil } func (p *TGetOperationStatusResp) IsSetErrorCode() bool { - return p.ErrorCode != nil + return p.ErrorCode != nil } func (p *TGetOperationStatusResp) IsSetErrorMessage() bool { - return p.ErrorMessage != nil + return p.ErrorMessage != nil } func (p *TGetOperationStatusResp) IsSetTaskStatus() bool { - return p.TaskStatus != nil + return p.TaskStatus != nil } func (p *TGetOperationStatusResp) IsSetOperationStarted() bool { - return p.OperationStarted != nil + return p.OperationStarted != nil } func (p *TGetOperationStatusResp) IsSetOperationCompleted() bool { - return p.OperationCompleted != nil + return p.OperationCompleted != nil } func (p *TGetOperationStatusResp) IsSetHasResultSet() bool { - return p.HasResultSet != nil + return p.HasResultSet != nil } func (p *TGetOperationStatusResp) IsSetProgressUpdateResponse() bool { - return p.ProgressUpdateResponse != nil + return p.ProgressUpdateResponse != nil } func (p *TGetOperationStatusResp) IsSetNumModifiedRows() bool { - return p.NumModifiedRows != nil + return p.NumModifiedRows != nil } func (p *TGetOperationStatusResp) IsSetDisplayMessage() bool { - return p.DisplayMessage != nil + return p.DisplayMessage != nil } func (p *TGetOperationStatusResp) IsSetDiagnosticInfo() bool { - return p.DiagnosticInfo != nil + return p.DiagnosticInfo != nil } func (p *TGetOperationStatusResp) IsSetErrorDetailsJson() bool { - return p.ErrorDetailsJson != nil + return p.ErrorDetailsJson != nil } func (p *TGetOperationStatusResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I32 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.STRING { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 7: - if fieldTypeId == thrift.I64 { - if err := p.ReadField7(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 8: - if fieldTypeId == thrift.I64 { - if err := p.ReadField8(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 9: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField9(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 10: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField10(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 11: - if fieldTypeId == thrift.I64 { - if err := p.ReadField11(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1283: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1283(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TOperationState(v) - p.OperationState = &temp - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.SqlState = &v - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.ErrorCode = &v - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - p.ErrorMessage = &v - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) - } else { - p.TaskStatus = &v - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 7: ", err) - } else { - p.OperationStarted = &v - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 8: ", err) - } else { - p.OperationCompleted = &v - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 9: ", err) - } else { - p.HasResultSet = &v - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { - p.ProgressUpdateResponse = &TProgressUpdateResp{} - if err := p.ProgressUpdateResponse.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProgressUpdateResponse), err) - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField11(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 11: ", err) - } else { - p.NumModifiedRows = &v - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1281: ", err) - } else { - p.DisplayMessage = &v - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.DiagnosticInfo = &v - } - return nil -} - -func (p *TGetOperationStatusResp) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 1283: ", err) - } else { - p.ErrorDetailsJson = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I64 { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.I64 { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField9(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField10(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.I64 { + if err := p.ReadField11(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1283: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1283(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TOperationState(v) + p.OperationState = &temp +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SqlState = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.ErrorCode = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.ErrorMessage = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.TaskStatus = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.OperationStarted = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.OperationCompleted = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.HasResultSet = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { + p.ProgressUpdateResponse = &TProgressUpdateResp{} + if err := p.ProgressUpdateResponse.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProgressUpdateResponse), err) + } + return nil +} + +func (p *TGetOperationStatusResp) ReadField11(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 11: ", err) +} else { + p.NumModifiedRows = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1281: ", err) +} else { + p.DisplayMessage = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.DiagnosticInfo = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1283: ", err) +} else { + p.ErrorDetailsJson = &v +} + return nil } func (p *TGetOperationStatusResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetOperationStatusResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - if err := p.writeField6(ctx, oprot); err != nil { - return err - } - if err := p.writeField7(ctx, oprot); err != nil { - return err - } - if err := p.writeField8(ctx, oprot); err != nil { - return err - } - if err := p.writeField9(ctx, oprot); err != nil { - return err - } - if err := p.writeField10(ctx, oprot); err != nil { - return err - } - if err := p.writeField11(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - if err := p.writeField1283(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetOperationStatusResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + if err := p.writeField9(ctx, oprot); err != nil { return err } + if err := p.writeField10(ctx, oprot); err != nil { return err } + if err := p.writeField11(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + if err := p.writeField1283(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetOperationStatusResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TGetOperationStatusResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationState() { - if err := oprot.WriteFieldBegin(ctx, "operationState", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationState: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.OperationState)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationState (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationState: ", p), err) - } - } - return err + if p.IsSetOperationState() { + if err := oprot.WriteFieldBegin(ctx, "operationState", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationState: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.OperationState)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationState (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationState: ", p), err) } + } + return err } func (p *TGetOperationStatusResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSqlState() { - if err := oprot.WriteFieldBegin(ctx, "sqlState", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.SqlState)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) - } - } - return err + if p.IsSetSqlState() { + if err := oprot.WriteFieldBegin(ctx, "sqlState", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.SqlState)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) } + } + return err } func (p *TGetOperationStatusResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorCode() { - if err := oprot.WriteFieldBegin(ctx, "errorCode", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.ErrorCode)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) - } - } - return err + if p.IsSetErrorCode() { + if err := oprot.WriteFieldBegin(ctx, "errorCode", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) } + } + return err } func (p *TGetOperationStatusResp) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorMessage() { - if err := oprot.WriteFieldBegin(ctx, "errorMessage", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.ErrorMessage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) - } - } - return err + if p.IsSetErrorMessage() { + if err := oprot.WriteFieldBegin(ctx, "errorMessage", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ErrorMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) } + } + return err } func (p *TGetOperationStatusResp) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetTaskStatus() { - if err := oprot.WriteFieldBegin(ctx, "taskStatus", thrift.STRING, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:taskStatus: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.TaskStatus)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.taskStatus (6) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:taskStatus: ", p), err) - } - } - return err + if p.IsSetTaskStatus() { + if err := oprot.WriteFieldBegin(ctx, "taskStatus", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:taskStatus: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.TaskStatus)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.taskStatus (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:taskStatus: ", p), err) } + } + return err } func (p *TGetOperationStatusResp) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationStarted() { - if err := oprot.WriteFieldBegin(ctx, "operationStarted", thrift.I64, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:operationStarted: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.OperationStarted)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationStarted (7) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:operationStarted: ", p), err) - } - } - return err + if p.IsSetOperationStarted() { + if err := oprot.WriteFieldBegin(ctx, "operationStarted", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:operationStarted: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.OperationStarted)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationStarted (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:operationStarted: ", p), err) } + } + return err } func (p *TGetOperationStatusResp) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetOperationCompleted() { - if err := oprot.WriteFieldBegin(ctx, "operationCompleted", thrift.I64, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:operationCompleted: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.OperationCompleted)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationCompleted (8) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:operationCompleted: ", p), err) - } - } - return err + if p.IsSetOperationCompleted() { + if err := oprot.WriteFieldBegin(ctx, "operationCompleted", thrift.I64, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:operationCompleted: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.OperationCompleted)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationCompleted (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:operationCompleted: ", p), err) } + } + return err } func (p *TGetOperationStatusResp) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetHasResultSet() { - if err := oprot.WriteFieldBegin(ctx, "hasResultSet", thrift.BOOL, 9); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:hasResultSet: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.HasResultSet)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (9) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 9:hasResultSet: ", p), err) - } - } - return err + if p.IsSetHasResultSet() { + if err := oprot.WriteFieldBegin(ctx, "hasResultSet", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:hasResultSet: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.HasResultSet)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:hasResultSet: ", p), err) } + } + return err } func (p *TGetOperationStatusResp) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetProgressUpdateResponse() { - if err := oprot.WriteFieldBegin(ctx, "progressUpdateResponse", thrift.STRUCT, 10); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:progressUpdateResponse: ", p), err) - } - if err := p.ProgressUpdateResponse.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProgressUpdateResponse), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 10:progressUpdateResponse: ", p), err) - } - } - return err + if p.IsSetProgressUpdateResponse() { + if err := oprot.WriteFieldBegin(ctx, "progressUpdateResponse", thrift.STRUCT, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:progressUpdateResponse: ", p), err) } + if err := p.ProgressUpdateResponse.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProgressUpdateResponse), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:progressUpdateResponse: ", p), err) } + } + return err } func (p *TGetOperationStatusResp) writeField11(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetNumModifiedRows() { - if err := oprot.WriteFieldBegin(ctx, "numModifiedRows", thrift.I64, 11); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:numModifiedRows: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.NumModifiedRows)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.numModifiedRows (11) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 11:numModifiedRows: ", p), err) - } - } - return err + if p.IsSetNumModifiedRows() { + if err := oprot.WriteFieldBegin(ctx, "numModifiedRows", thrift.I64, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:numModifiedRows: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.NumModifiedRows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.numModifiedRows (11) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:numModifiedRows: ", p), err) } + } + return err } func (p *TGetOperationStatusResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDisplayMessage() { - if err := oprot.WriteFieldBegin(ctx, "displayMessage", thrift.STRING, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:displayMessage: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.DisplayMessage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.displayMessage (1281) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:displayMessage: ", p), err) - } - } - return err + if p.IsSetDisplayMessage() { + if err := oprot.WriteFieldBegin(ctx, "displayMessage", thrift.STRING, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:displayMessage: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.DisplayMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.displayMessage (1281) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:displayMessage: ", p), err) } + } + return err } func (p *TGetOperationStatusResp) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDiagnosticInfo() { - if err := oprot.WriteFieldBegin(ctx, "diagnosticInfo", thrift.STRING, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:diagnosticInfo: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.DiagnosticInfo)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.diagnosticInfo (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:diagnosticInfo: ", p), err) - } - } - return err + if p.IsSetDiagnosticInfo() { + if err := oprot.WriteFieldBegin(ctx, "diagnosticInfo", thrift.STRING, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:diagnosticInfo: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.DiagnosticInfo)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.diagnosticInfo (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:diagnosticInfo: ", p), err) } + } + return err } func (p *TGetOperationStatusResp) writeField1283(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetErrorDetailsJson() { - if err := oprot.WriteFieldBegin(ctx, "errorDetailsJson", thrift.STRING, 1283); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:errorDetailsJson: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.ErrorDetailsJson)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorDetailsJson (1283) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:errorDetailsJson: ", p), err) - } - } - return err + if p.IsSetErrorDetailsJson() { + if err := oprot.WriteFieldBegin(ctx, "errorDetailsJson", thrift.STRING, 1283); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:errorDetailsJson: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ErrorDetailsJson)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorDetailsJson (1283) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:errorDetailsJson: ", p), err) } + } + return err } func (p *TGetOperationStatusResp) Equals(other *TGetOperationStatusResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if p.OperationState != other.OperationState { - if p.OperationState == nil || other.OperationState == nil { - return false - } - if (*p.OperationState) != (*other.OperationState) { - return false - } - } - if p.SqlState != other.SqlState { - if p.SqlState == nil || other.SqlState == nil { - return false - } - if (*p.SqlState) != (*other.SqlState) { - return false - } - } - if p.ErrorCode != other.ErrorCode { - if p.ErrorCode == nil || other.ErrorCode == nil { - return false - } - if (*p.ErrorCode) != (*other.ErrorCode) { - return false - } - } - if p.ErrorMessage != other.ErrorMessage { - if p.ErrorMessage == nil || other.ErrorMessage == nil { - return false - } - if (*p.ErrorMessage) != (*other.ErrorMessage) { - return false - } - } - if p.TaskStatus != other.TaskStatus { - if p.TaskStatus == nil || other.TaskStatus == nil { - return false - } - if (*p.TaskStatus) != (*other.TaskStatus) { - return false - } - } - if p.OperationStarted != other.OperationStarted { - if p.OperationStarted == nil || other.OperationStarted == nil { - return false - } - if (*p.OperationStarted) != (*other.OperationStarted) { - return false - } - } - if p.OperationCompleted != other.OperationCompleted { - if p.OperationCompleted == nil || other.OperationCompleted == nil { - return false - } - if (*p.OperationCompleted) != (*other.OperationCompleted) { - return false - } - } - if p.HasResultSet != other.HasResultSet { - if p.HasResultSet == nil || other.HasResultSet == nil { - return false - } - if (*p.HasResultSet) != (*other.HasResultSet) { - return false - } - } - if !p.ProgressUpdateResponse.Equals(other.ProgressUpdateResponse) { - return false - } - if p.NumModifiedRows != other.NumModifiedRows { - if p.NumModifiedRows == nil || other.NumModifiedRows == nil { - return false - } - if (*p.NumModifiedRows) != (*other.NumModifiedRows) { - return false - } - } - if p.DisplayMessage != other.DisplayMessage { - if p.DisplayMessage == nil || other.DisplayMessage == nil { - return false - } - if (*p.DisplayMessage) != (*other.DisplayMessage) { - return false - } - } - if p.DiagnosticInfo != other.DiagnosticInfo { - if p.DiagnosticInfo == nil || other.DiagnosticInfo == nil { - return false - } - if (*p.DiagnosticInfo) != (*other.DiagnosticInfo) { - return false - } - } - if p.ErrorDetailsJson != other.ErrorDetailsJson { - if p.ErrorDetailsJson == nil || other.ErrorDetailsJson == nil { - return false - } - if (*p.ErrorDetailsJson) != (*other.ErrorDetailsJson) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if p.OperationState != other.OperationState { + if p.OperationState == nil || other.OperationState == nil { + return false + } + if (*p.OperationState) != (*other.OperationState) { return false } + } + if p.SqlState != other.SqlState { + if p.SqlState == nil || other.SqlState == nil { + return false + } + if (*p.SqlState) != (*other.SqlState) { return false } + } + if p.ErrorCode != other.ErrorCode { + if p.ErrorCode == nil || other.ErrorCode == nil { + return false + } + if (*p.ErrorCode) != (*other.ErrorCode) { return false } + } + if p.ErrorMessage != other.ErrorMessage { + if p.ErrorMessage == nil || other.ErrorMessage == nil { + return false + } + if (*p.ErrorMessage) != (*other.ErrorMessage) { return false } + } + if p.TaskStatus != other.TaskStatus { + if p.TaskStatus == nil || other.TaskStatus == nil { + return false + } + if (*p.TaskStatus) != (*other.TaskStatus) { return false } + } + if p.OperationStarted != other.OperationStarted { + if p.OperationStarted == nil || other.OperationStarted == nil { + return false + } + if (*p.OperationStarted) != (*other.OperationStarted) { return false } + } + if p.OperationCompleted != other.OperationCompleted { + if p.OperationCompleted == nil || other.OperationCompleted == nil { + return false + } + if (*p.OperationCompleted) != (*other.OperationCompleted) { return false } + } + if p.HasResultSet != other.HasResultSet { + if p.HasResultSet == nil || other.HasResultSet == nil { + return false + } + if (*p.HasResultSet) != (*other.HasResultSet) { return false } + } + if !p.ProgressUpdateResponse.Equals(other.ProgressUpdateResponse) { return false } + if p.NumModifiedRows != other.NumModifiedRows { + if p.NumModifiedRows == nil || other.NumModifiedRows == nil { + return false + } + if (*p.NumModifiedRows) != (*other.NumModifiedRows) { return false } + } + if p.DisplayMessage != other.DisplayMessage { + if p.DisplayMessage == nil || other.DisplayMessage == nil { + return false + } + if (*p.DisplayMessage) != (*other.DisplayMessage) { return false } + } + if p.DiagnosticInfo != other.DiagnosticInfo { + if p.DiagnosticInfo == nil || other.DiagnosticInfo == nil { + return false + } + if (*p.DiagnosticInfo) != (*other.DiagnosticInfo) { return false } + } + if p.ErrorDetailsJson != other.ErrorDetailsJson { + if p.ErrorDetailsJson == nil || other.ErrorDetailsJson == nil { + return false + } + if (*p.ErrorDetailsJson) != (*other.ErrorDetailsJson) { return false } + } + return true } func (p *TGetOperationStatusResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetOperationStatusResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetOperationStatusResp(%+v)", *p) } func (p *TGetOperationStatusResp) Validate() error { - return nil + return nil } - // Attributes: -// - OperationHandle +// - OperationHandle type TCancelOperationReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` } func NewTCancelOperationReq() *TCancelOperationReq { - return &TCancelOperationReq{} + return &TCancelOperationReq{} } var TCancelOperationReq_OperationHandle_DEFAULT *TOperationHandle - func (p *TCancelOperationReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TCancelOperationReq_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TCancelOperationReq_OperationHandle_DEFAULT + } +return p.OperationHandle } func (p *TCancelOperationReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TCancelOperationReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")) - } - return nil -} - -func (p *TCancelOperationReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperationHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperationHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); + } + return nil +} + +func (p *TCancelOperationReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil } func (p *TCancelOperationReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCancelOperationReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TCancelOperationReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCancelOperationReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } + return err } func (p *TCancelOperationReq) Equals(other *TCancelOperationReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true } func (p *TCancelOperationReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCancelOperationReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCancelOperationReq(%+v)", *p) } func (p *TCancelOperationReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status +// - Status type TCancelOperationResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTCancelOperationResp() *TCancelOperationResp { - return &TCancelOperationResp{} + return &TCancelOperationResp{} } var TCancelOperationResp_Status_DEFAULT *TStatus - func (p *TCancelOperationResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCancelOperationResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TCancelOperationResp_Status_DEFAULT + } +return p.Status } func (p *TCancelOperationResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TCancelOperationResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TCancelOperationResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TCancelOperationResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil } func (p *TCancelOperationResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCancelOperationResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TCancelOperationResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCancelOperationResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TCancelOperationResp) Equals(other *TCancelOperationResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + return true } func (p *TCancelOperationResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCancelOperationResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCancelOperationResp(%+v)", *p) } func (p *TCancelOperationResp) Validate() error { - return nil + return nil } - // Attributes: -// - OperationHandle +// - OperationHandle type TCloseOperationReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` } func NewTCloseOperationReq() *TCloseOperationReq { - return &TCloseOperationReq{} + return &TCloseOperationReq{} } var TCloseOperationReq_OperationHandle_DEFAULT *TOperationHandle - func (p *TCloseOperationReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TCloseOperationReq_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TCloseOperationReq_OperationHandle_DEFAULT + } +return p.OperationHandle } func (p *TCloseOperationReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TCloseOperationReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")) - } - return nil -} - -func (p *TCloseOperationReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperationHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperationHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); + } + return nil +} + +func (p *TCloseOperationReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil } func (p *TCloseOperationReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCloseOperationReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TCloseOperationReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCloseOperationReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } + return err } func (p *TCloseOperationReq) Equals(other *TCloseOperationReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true } func (p *TCloseOperationReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCloseOperationReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCloseOperationReq(%+v)", *p) } func (p *TCloseOperationReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status +// - Status type TCloseOperationResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTCloseOperationResp() *TCloseOperationResp { - return &TCloseOperationResp{} + return &TCloseOperationResp{} } var TCloseOperationResp_Status_DEFAULT *TStatus - func (p *TCloseOperationResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCloseOperationResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TCloseOperationResp_Status_DEFAULT + } +return p.Status } func (p *TCloseOperationResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TCloseOperationResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TCloseOperationResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TCloseOperationResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil } func (p *TCloseOperationResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCloseOperationResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TCloseOperationResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCloseOperationResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TCloseOperationResp) Equals(other *TCloseOperationResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + return true } func (p *TCloseOperationResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCloseOperationResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCloseOperationResp(%+v)", *p) } func (p *TCloseOperationResp) Validate() error { - return nil + return nil } - // Attributes: -// - OperationHandle +// - OperationHandle type TGetResultSetMetadataReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` } func NewTGetResultSetMetadataReq() *TGetResultSetMetadataReq { - return &TGetResultSetMetadataReq{} + return &TGetResultSetMetadataReq{} } var TGetResultSetMetadataReq_OperationHandle_DEFAULT *TOperationHandle - func (p *TGetResultSetMetadataReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetResultSetMetadataReq_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TGetResultSetMetadataReq_OperationHandle_DEFAULT + } +return p.OperationHandle } func (p *TGetResultSetMetadataReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TGetResultSetMetadataReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")) - } - return nil -} - -func (p *TGetResultSetMetadataReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperationHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperationHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); + } + return nil +} + +func (p *TGetResultSetMetadataReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil } func (p *TGetResultSetMetadataReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetResultSetMetadataReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetResultSetMetadataReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetResultSetMetadataReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } + return err } func (p *TGetResultSetMetadataReq) Equals(other *TGetResultSetMetadataReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true } func (p *TGetResultSetMetadataReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetResultSetMetadataReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetResultSetMetadataReq(%+v)", *p) } func (p *TGetResultSetMetadataReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - Schema -// - ResultFormat -// - Lz4Compressed -// - ArrowSchema -// - CacheLookupResult_ -// - UncompressedBytes -// - CompressedBytes -// - IsStagingOperation +// - Status +// - Schema +// - ResultFormat +// - Lz4Compressed +// - ArrowSchema +// - CacheLookupResult_ +// - UncompressedBytes +// - CompressedBytes +// - IsStagingOperation type TGetResultSetMetadataResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - Schema *TTableSchema `thrift:"schema,2" db:"schema" json:"schema,omitempty"` - // unused fields # 3 to 1280 - ResultFormat *TSparkRowSetType `thrift:"resultFormat,1281" db:"resultFormat" json:"resultFormat,omitempty"` - Lz4Compressed *bool `thrift:"lz4Compressed,1282" db:"lz4Compressed" json:"lz4Compressed,omitempty"` - ArrowSchema []byte `thrift:"arrowSchema,1283" db:"arrowSchema" json:"arrowSchema,omitempty"` - CacheLookupResult_ *TCacheLookupResult_ `thrift:"cacheLookupResult,1284" db:"cacheLookupResult" json:"cacheLookupResult,omitempty"` - UncompressedBytes *int64 `thrift:"uncompressedBytes,1285" db:"uncompressedBytes" json:"uncompressedBytes,omitempty"` - CompressedBytes *int64 `thrift:"compressedBytes,1286" db:"compressedBytes" json:"compressedBytes,omitempty"` - IsStagingOperation *bool `thrift:"isStagingOperation,1287" db:"isStagingOperation" json:"isStagingOperation,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Schema *TTableSchema `thrift:"schema,2" db:"schema" json:"schema,omitempty"` + // unused fields # 3 to 1280 + ResultFormat *TSparkRowSetType `thrift:"resultFormat,1281" db:"resultFormat" json:"resultFormat,omitempty"` + Lz4Compressed *bool `thrift:"lz4Compressed,1282" db:"lz4Compressed" json:"lz4Compressed,omitempty"` + ArrowSchema []byte `thrift:"arrowSchema,1283" db:"arrowSchema" json:"arrowSchema,omitempty"` + CacheLookupResult_ *TCacheLookupResult_ `thrift:"cacheLookupResult,1284" db:"cacheLookupResult" json:"cacheLookupResult,omitempty"` + UncompressedBytes *int64 `thrift:"uncompressedBytes,1285" db:"uncompressedBytes" json:"uncompressedBytes,omitempty"` + CompressedBytes *int64 `thrift:"compressedBytes,1286" db:"compressedBytes" json:"compressedBytes,omitempty"` + IsStagingOperation *bool `thrift:"isStagingOperation,1287" db:"isStagingOperation" json:"isStagingOperation,omitempty"` } func NewTGetResultSetMetadataResp() *TGetResultSetMetadataResp { - return &TGetResultSetMetadataResp{} + return &TGetResultSetMetadataResp{} } var TGetResultSetMetadataResp_Status_DEFAULT *TStatus - func (p *TGetResultSetMetadataResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetResultSetMetadataResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TGetResultSetMetadataResp_Status_DEFAULT + } +return p.Status } - var TGetResultSetMetadataResp_Schema_DEFAULT *TTableSchema - func (p *TGetResultSetMetadataResp) GetSchema() *TTableSchema { - if !p.IsSetSchema() { - return TGetResultSetMetadataResp_Schema_DEFAULT - } - return p.Schema + if !p.IsSetSchema() { + return TGetResultSetMetadataResp_Schema_DEFAULT + } +return p.Schema } - var TGetResultSetMetadataResp_ResultFormat_DEFAULT TSparkRowSetType - func (p *TGetResultSetMetadataResp) GetResultFormat() TSparkRowSetType { - if !p.IsSetResultFormat() { - return TGetResultSetMetadataResp_ResultFormat_DEFAULT - } - return *p.ResultFormat + if !p.IsSetResultFormat() { + return TGetResultSetMetadataResp_ResultFormat_DEFAULT + } +return *p.ResultFormat } - var TGetResultSetMetadataResp_Lz4Compressed_DEFAULT bool - func (p *TGetResultSetMetadataResp) GetLz4Compressed() bool { - if !p.IsSetLz4Compressed() { - return TGetResultSetMetadataResp_Lz4Compressed_DEFAULT - } - return *p.Lz4Compressed + if !p.IsSetLz4Compressed() { + return TGetResultSetMetadataResp_Lz4Compressed_DEFAULT + } +return *p.Lz4Compressed } - var TGetResultSetMetadataResp_ArrowSchema_DEFAULT []byte func (p *TGetResultSetMetadataResp) GetArrowSchema() []byte { - return p.ArrowSchema + return p.ArrowSchema } - var TGetResultSetMetadataResp_CacheLookupResult__DEFAULT TCacheLookupResult_ - func (p *TGetResultSetMetadataResp) GetCacheLookupResult_() TCacheLookupResult_ { - if !p.IsSetCacheLookupResult_() { - return TGetResultSetMetadataResp_CacheLookupResult__DEFAULT - } - return *p.CacheLookupResult_ + if !p.IsSetCacheLookupResult_() { + return TGetResultSetMetadataResp_CacheLookupResult__DEFAULT + } +return *p.CacheLookupResult_ } - var TGetResultSetMetadataResp_UncompressedBytes_DEFAULT int64 - func (p *TGetResultSetMetadataResp) GetUncompressedBytes() int64 { - if !p.IsSetUncompressedBytes() { - return TGetResultSetMetadataResp_UncompressedBytes_DEFAULT - } - return *p.UncompressedBytes + if !p.IsSetUncompressedBytes() { + return TGetResultSetMetadataResp_UncompressedBytes_DEFAULT + } +return *p.UncompressedBytes } - var TGetResultSetMetadataResp_CompressedBytes_DEFAULT int64 - func (p *TGetResultSetMetadataResp) GetCompressedBytes() int64 { - if !p.IsSetCompressedBytes() { - return TGetResultSetMetadataResp_CompressedBytes_DEFAULT - } - return *p.CompressedBytes + if !p.IsSetCompressedBytes() { + return TGetResultSetMetadataResp_CompressedBytes_DEFAULT + } +return *p.CompressedBytes } - var TGetResultSetMetadataResp_IsStagingOperation_DEFAULT bool - func (p *TGetResultSetMetadataResp) GetIsStagingOperation() bool { - if !p.IsSetIsStagingOperation() { - return TGetResultSetMetadataResp_IsStagingOperation_DEFAULT - } - return *p.IsStagingOperation + if !p.IsSetIsStagingOperation() { + return TGetResultSetMetadataResp_IsStagingOperation_DEFAULT + } +return *p.IsStagingOperation } func (p *TGetResultSetMetadataResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetResultSetMetadataResp) IsSetSchema() bool { - return p.Schema != nil + return p.Schema != nil } func (p *TGetResultSetMetadataResp) IsSetResultFormat() bool { - return p.ResultFormat != nil + return p.ResultFormat != nil } func (p *TGetResultSetMetadataResp) IsSetLz4Compressed() bool { - return p.Lz4Compressed != nil + return p.Lz4Compressed != nil } func (p *TGetResultSetMetadataResp) IsSetArrowSchema() bool { - return p.ArrowSchema != nil + return p.ArrowSchema != nil } func (p *TGetResultSetMetadataResp) IsSetCacheLookupResult_() bool { - return p.CacheLookupResult_ != nil + return p.CacheLookupResult_ != nil } func (p *TGetResultSetMetadataResp) IsSetUncompressedBytes() bool { - return p.UncompressedBytes != nil + return p.UncompressedBytes != nil } func (p *TGetResultSetMetadataResp) IsSetCompressedBytes() bool { - return p.CompressedBytes != nil + return p.CompressedBytes != nil } func (p *TGetResultSetMetadataResp) IsSetIsStagingOperation() bool { - return p.IsStagingOperation != nil + return p.IsStagingOperation != nil } func (p *TGetResultSetMetadataResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1283: - if fieldTypeId == thrift.STRING { - if err := p.ReadField1283(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1284: - if fieldTypeId == thrift.I32 { - if err := p.ReadField1284(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1285: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1285(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1286: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1286(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1287: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1287(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - p.Schema = &TTableSchema{} - if err := p.Schema.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) - } - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1281: ", err) - } else { - temp := TSparkRowSetType(v) - p.ResultFormat = &temp - } - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.Lz4Compressed = &v - } - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(ctx); err != nil { - return thrift.PrependError("error reading field 1283: ", err) - } else { - p.ArrowSchema = v - } - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 1284: ", err) - } else { - temp := TCacheLookupResult_(v) - p.CacheLookupResult_ = &temp - } - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1285: ", err) - } else { - p.UncompressedBytes = &v - } - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1286(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1286: ", err) - } else { - p.CompressedBytes = &v - } - return nil -} - -func (p *TGetResultSetMetadataResp) ReadField1287(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1287: ", err) - } else { - p.IsStagingOperation = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1283: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1283(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1284: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1284(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1285: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1285(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1286: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1286(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1287: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1287(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Schema = &TTableSchema{} + if err := p.Schema.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1281: ", err) +} else { + temp := TSparkRowSetType(v) + p.ResultFormat = &temp +} + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.Lz4Compressed = &v +} + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1283: ", err) +} else { + p.ArrowSchema = v +} + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1284(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1284: ", err) +} else { + temp := TCacheLookupResult_(v) + p.CacheLookupResult_ = &temp +} + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1285(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1285: ", err) +} else { + p.UncompressedBytes = &v +} + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1286(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1286: ", err) +} else { + p.CompressedBytes = &v +} + return nil +} + +func (p *TGetResultSetMetadataResp) ReadField1287(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1287: ", err) +} else { + p.IsStagingOperation = &v +} + return nil } func (p *TGetResultSetMetadataResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetResultSetMetadataResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - if err := p.writeField1283(ctx, oprot); err != nil { - return err - } - if err := p.writeField1284(ctx, oprot); err != nil { - return err - } - if err := p.writeField1285(ctx, oprot); err != nil { - return err - } - if err := p.writeField1286(ctx, oprot); err != nil { - return err - } - if err := p.writeField1287(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetResultSetMetadataResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + if err := p.writeField1283(ctx, oprot); err != nil { return err } + if err := p.writeField1284(ctx, oprot); err != nil { return err } + if err := p.writeField1285(ctx, oprot); err != nil { return err } + if err := p.writeField1286(ctx, oprot); err != nil { return err } + if err := p.writeField1287(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetResultSetMetadataResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TGetResultSetMetadataResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSchema() { - if err := oprot.WriteFieldBegin(ctx, "schema", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema: ", p), err) - } - if err := p.Schema.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema: ", p), err) - } - } - return err + if p.IsSetSchema() { + if err := oprot.WriteFieldBegin(ctx, "schema", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema: ", p), err) } + if err := p.Schema.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema: ", p), err) } + } + return err } func (p *TGetResultSetMetadataResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResultFormat() { - if err := oprot.WriteFieldBegin(ctx, "resultFormat", thrift.I32, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:resultFormat: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.ResultFormat)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.resultFormat (1281) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:resultFormat: ", p), err) - } - } - return err + if p.IsSetResultFormat() { + if err := oprot.WriteFieldBegin(ctx, "resultFormat", thrift.I32, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:resultFormat: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.ResultFormat)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.resultFormat (1281) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:resultFormat: ", p), err) } + } + return err } func (p *TGetResultSetMetadataResp) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetLz4Compressed() { - if err := oprot.WriteFieldBegin(ctx, "lz4Compressed", thrift.BOOL, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:lz4Compressed: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.Lz4Compressed)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.lz4Compressed (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:lz4Compressed: ", p), err) - } - } - return err + if p.IsSetLz4Compressed() { + if err := oprot.WriteFieldBegin(ctx, "lz4Compressed", thrift.BOOL, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:lz4Compressed: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.Lz4Compressed)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.lz4Compressed (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:lz4Compressed: ", p), err) } + } + return err } func (p *TGetResultSetMetadataResp) writeField1283(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetArrowSchema() { - if err := oprot.WriteFieldBegin(ctx, "arrowSchema", thrift.STRING, 1283); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:arrowSchema: ", p), err) - } - if err := oprot.WriteBinary(ctx, p.ArrowSchema); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.arrowSchema (1283) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:arrowSchema: ", p), err) - } - } - return err + if p.IsSetArrowSchema() { + if err := oprot.WriteFieldBegin(ctx, "arrowSchema", thrift.STRING, 1283); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:arrowSchema: ", p), err) } + if err := oprot.WriteBinary(ctx, p.ArrowSchema); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.arrowSchema (1283) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:arrowSchema: ", p), err) } + } + return err } func (p *TGetResultSetMetadataResp) writeField1284(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCacheLookupResult_() { - if err := oprot.WriteFieldBegin(ctx, "cacheLookupResult", thrift.I32, 1284); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:cacheLookupResult: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(*p.CacheLookupResult_)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.cacheLookupResult (1284) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:cacheLookupResult: ", p), err) - } - } - return err + if p.IsSetCacheLookupResult_() { + if err := oprot.WriteFieldBegin(ctx, "cacheLookupResult", thrift.I32, 1284); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1284:cacheLookupResult: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.CacheLookupResult_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cacheLookupResult (1284) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1284:cacheLookupResult: ", p), err) } + } + return err } func (p *TGetResultSetMetadataResp) writeField1285(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetUncompressedBytes() { - if err := oprot.WriteFieldBegin(ctx, "uncompressedBytes", thrift.I64, 1285); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:uncompressedBytes: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.UncompressedBytes)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.uncompressedBytes (1285) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:uncompressedBytes: ", p), err) - } - } - return err + if p.IsSetUncompressedBytes() { + if err := oprot.WriteFieldBegin(ctx, "uncompressedBytes", thrift.I64, 1285); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1285:uncompressedBytes: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.UncompressedBytes)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.uncompressedBytes (1285) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1285:uncompressedBytes: ", p), err) } + } + return err } func (p *TGetResultSetMetadataResp) writeField1286(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetCompressedBytes() { - if err := oprot.WriteFieldBegin(ctx, "compressedBytes", thrift.I64, 1286); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1286:compressedBytes: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.CompressedBytes)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.compressedBytes (1286) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1286:compressedBytes: ", p), err) - } - } - return err + if p.IsSetCompressedBytes() { + if err := oprot.WriteFieldBegin(ctx, "compressedBytes", thrift.I64, 1286); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1286:compressedBytes: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.CompressedBytes)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.compressedBytes (1286) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1286:compressedBytes: ", p), err) } + } + return err } func (p *TGetResultSetMetadataResp) writeField1287(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetIsStagingOperation() { - if err := oprot.WriteFieldBegin(ctx, "isStagingOperation", thrift.BOOL, 1287); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1287:isStagingOperation: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.IsStagingOperation)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.isStagingOperation (1287) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1287:isStagingOperation: ", p), err) - } - } - return err + if p.IsSetIsStagingOperation() { + if err := oprot.WriteFieldBegin(ctx, "isStagingOperation", thrift.BOOL, 1287); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1287:isStagingOperation: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.IsStagingOperation)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.isStagingOperation (1287) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1287:isStagingOperation: ", p), err) } + } + return err } func (p *TGetResultSetMetadataResp) Equals(other *TGetResultSetMetadataResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if !p.Schema.Equals(other.Schema) { - return false - } - if p.ResultFormat != other.ResultFormat { - if p.ResultFormat == nil || other.ResultFormat == nil { - return false - } - if (*p.ResultFormat) != (*other.ResultFormat) { - return false - } - } - if p.Lz4Compressed != other.Lz4Compressed { - if p.Lz4Compressed == nil || other.Lz4Compressed == nil { - return false - } - if (*p.Lz4Compressed) != (*other.Lz4Compressed) { - return false - } - } - if bytes.Compare(p.ArrowSchema, other.ArrowSchema) != 0 { - return false - } - if p.CacheLookupResult_ != other.CacheLookupResult_ { - if p.CacheLookupResult_ == nil || other.CacheLookupResult_ == nil { - return false - } - if (*p.CacheLookupResult_) != (*other.CacheLookupResult_) { - return false - } - } - if p.UncompressedBytes != other.UncompressedBytes { - if p.UncompressedBytes == nil || other.UncompressedBytes == nil { - return false - } - if (*p.UncompressedBytes) != (*other.UncompressedBytes) { - return false - } - } - if p.CompressedBytes != other.CompressedBytes { - if p.CompressedBytes == nil || other.CompressedBytes == nil { - return false - } - if (*p.CompressedBytes) != (*other.CompressedBytes) { - return false - } - } - if p.IsStagingOperation != other.IsStagingOperation { - if p.IsStagingOperation == nil || other.IsStagingOperation == nil { - return false - } - if (*p.IsStagingOperation) != (*other.IsStagingOperation) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.Schema.Equals(other.Schema) { return false } + if p.ResultFormat != other.ResultFormat { + if p.ResultFormat == nil || other.ResultFormat == nil { + return false + } + if (*p.ResultFormat) != (*other.ResultFormat) { return false } + } + if p.Lz4Compressed != other.Lz4Compressed { + if p.Lz4Compressed == nil || other.Lz4Compressed == nil { + return false + } + if (*p.Lz4Compressed) != (*other.Lz4Compressed) { return false } + } + if bytes.Compare(p.ArrowSchema, other.ArrowSchema) != 0 { return false } + if p.CacheLookupResult_ != other.CacheLookupResult_ { + if p.CacheLookupResult_ == nil || other.CacheLookupResult_ == nil { + return false + } + if (*p.CacheLookupResult_) != (*other.CacheLookupResult_) { return false } + } + if p.UncompressedBytes != other.UncompressedBytes { + if p.UncompressedBytes == nil || other.UncompressedBytes == nil { + return false + } + if (*p.UncompressedBytes) != (*other.UncompressedBytes) { return false } + } + if p.CompressedBytes != other.CompressedBytes { + if p.CompressedBytes == nil || other.CompressedBytes == nil { + return false + } + if (*p.CompressedBytes) != (*other.CompressedBytes) { return false } + } + if p.IsStagingOperation != other.IsStagingOperation { + if p.IsStagingOperation == nil || other.IsStagingOperation == nil { + return false + } + if (*p.IsStagingOperation) != (*other.IsStagingOperation) { return false } + } + return true } func (p *TGetResultSetMetadataResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetResultSetMetadataResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetResultSetMetadataResp(%+v)", *p) } func (p *TGetResultSetMetadataResp) Validate() error { - return nil + return nil } - // Attributes: -// - OperationHandle -// - Orientation -// - MaxRows -// - FetchType -// - MaxBytes -// - StartRowOffset -// - IncludeResultSetMetadata +// - OperationHandle +// - Orientation +// - MaxRows +// - FetchType +// - MaxBytes +// - StartRowOffset +// - IncludeResultSetMetadata type TFetchResultsReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` - Orientation TFetchOrientation `thrift:"orientation,2,required" db:"orientation" json:"orientation"` - MaxRows int64 `thrift:"maxRows,3,required" db:"maxRows" json:"maxRows"` - FetchType int16 `thrift:"fetchType,4" db:"fetchType" json:"fetchType"` - // unused fields # 5 to 1280 - MaxBytes *int64 `thrift:"maxBytes,1281" db:"maxBytes" json:"maxBytes,omitempty"` - StartRowOffset *int64 `thrift:"startRowOffset,1282" db:"startRowOffset" json:"startRowOffset,omitempty"` - IncludeResultSetMetadata *bool `thrift:"includeResultSetMetadata,1283" db:"includeResultSetMetadata" json:"includeResultSetMetadata,omitempty"` + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + Orientation TFetchOrientation `thrift:"orientation,2,required" db:"orientation" json:"orientation"` + MaxRows int64 `thrift:"maxRows,3,required" db:"maxRows" json:"maxRows"` + FetchType int16 `thrift:"fetchType,4" db:"fetchType" json:"fetchType"` + // unused fields # 5 to 1280 + MaxBytes *int64 `thrift:"maxBytes,1281" db:"maxBytes" json:"maxBytes,omitempty"` + StartRowOffset *int64 `thrift:"startRowOffset,1282" db:"startRowOffset" json:"startRowOffset,omitempty"` + IncludeResultSetMetadata *bool `thrift:"includeResultSetMetadata,1283" db:"includeResultSetMetadata" json:"includeResultSetMetadata,omitempty"` } func NewTFetchResultsReq() *TFetchResultsReq { - return &TFetchResultsReq{ - Orientation: 0, - } + return &TFetchResultsReq{ +Orientation: 0, +} } var TFetchResultsReq_OperationHandle_DEFAULT *TOperationHandle - func (p *TFetchResultsReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TFetchResultsReq_OperationHandle_DEFAULT - } - return p.OperationHandle + if !p.IsSetOperationHandle() { + return TFetchResultsReq_OperationHandle_DEFAULT + } +return p.OperationHandle } func (p *TFetchResultsReq) GetOrientation() TFetchOrientation { - return p.Orientation + return p.Orientation } func (p *TFetchResultsReq) GetMaxRows() int64 { - return p.MaxRows + return p.MaxRows } - var TFetchResultsReq_FetchType_DEFAULT int16 = 0 func (p *TFetchResultsReq) GetFetchType() int16 { - return p.FetchType + return p.FetchType } - var TFetchResultsReq_MaxBytes_DEFAULT int64 - func (p *TFetchResultsReq) GetMaxBytes() int64 { - if !p.IsSetMaxBytes() { - return TFetchResultsReq_MaxBytes_DEFAULT - } - return *p.MaxBytes + if !p.IsSetMaxBytes() { + return TFetchResultsReq_MaxBytes_DEFAULT + } +return *p.MaxBytes } - var TFetchResultsReq_StartRowOffset_DEFAULT int64 - func (p *TFetchResultsReq) GetStartRowOffset() int64 { - if !p.IsSetStartRowOffset() { - return TFetchResultsReq_StartRowOffset_DEFAULT - } - return *p.StartRowOffset + if !p.IsSetStartRowOffset() { + return TFetchResultsReq_StartRowOffset_DEFAULT + } +return *p.StartRowOffset } - var TFetchResultsReq_IncludeResultSetMetadata_DEFAULT bool - func (p *TFetchResultsReq) GetIncludeResultSetMetadata() bool { - if !p.IsSetIncludeResultSetMetadata() { - return TFetchResultsReq_IncludeResultSetMetadata_DEFAULT - } - return *p.IncludeResultSetMetadata + if !p.IsSetIncludeResultSetMetadata() { + return TFetchResultsReq_IncludeResultSetMetadata_DEFAULT + } +return *p.IncludeResultSetMetadata } func (p *TFetchResultsReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return p.OperationHandle != nil } func (p *TFetchResultsReq) IsSetFetchType() bool { - return p.FetchType != TFetchResultsReq_FetchType_DEFAULT + return p.FetchType != TFetchResultsReq_FetchType_DEFAULT } func (p *TFetchResultsReq) IsSetMaxBytes() bool { - return p.MaxBytes != nil + return p.MaxBytes != nil } func (p *TFetchResultsReq) IsSetStartRowOffset() bool { - return p.StartRowOffset != nil + return p.StartRowOffset != nil } func (p *TFetchResultsReq) IsSetIncludeResultSetMetadata() bool { - return p.IncludeResultSetMetadata != nil + return p.IncludeResultSetMetadata != nil } func (p *TFetchResultsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false - var issetOrientation bool = false - var issetMaxRows bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetOrientation = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.I64 { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetMaxRows = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I16 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1282: - if fieldTypeId == thrift.I64 { - if err := p.ReadField1282(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1283: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField1283(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")) - } - if !issetOrientation { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Orientation is not set")) - } - if !issetMaxRows { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxRows is not set")) - } - return nil -} - -func (p *TFetchResultsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TFetchResultsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := TFetchOrientation(v) - p.Orientation = temp - } - return nil -} - -func (p *TFetchResultsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.MaxRows = v - } - return nil -} - -func (p *TFetchResultsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.FetchType = v - } - return nil -} - -func (p *TFetchResultsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1281: ", err) - } else { - p.MaxBytes = &v - } - return nil -} - -func (p *TFetchResultsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 1282: ", err) - } else { - p.StartRowOffset = &v - } - return nil -} - -func (p *TFetchResultsReq) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 1283: ", err) - } else { - p.IncludeResultSetMetadata = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperationHandle bool = false; + var issetOrientation bool = false; + var issetMaxRows bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetOrientation = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetMaxRows = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I16 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1282: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1282(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1283: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1283(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperationHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); + } + if !issetOrientation{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Orientation is not set")); + } + if !issetMaxRows{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxRows is not set")); + } + return nil +} + +func (p *TFetchResultsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TFetchResultsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TFetchOrientation(v) + p.Orientation = temp +} + return nil +} + +func (p *TFetchResultsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.MaxRows = v +} + return nil +} + +func (p *TFetchResultsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.FetchType = v +} + return nil +} + +func (p *TFetchResultsReq) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1281: ", err) +} else { + p.MaxBytes = &v +} + return nil +} + +func (p *TFetchResultsReq) ReadField1282(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1282: ", err) +} else { + p.StartRowOffset = &v +} + return nil +} + +func (p *TFetchResultsReq) ReadField1283(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1283: ", err) +} else { + p.IncludeResultSetMetadata = &v +} + return nil } func (p *TFetchResultsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TFetchResultsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - if err := p.writeField1282(ctx, oprot); err != nil { - return err - } - if err := p.writeField1283(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TFetchResultsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + if err := p.writeField1282(ctx, oprot); err != nil { return err } + if err := p.writeField1283(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TFetchResultsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) - } - if err := p.OperationHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } + return err } func (p *TFetchResultsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "orientation", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:orientation: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(p.Orientation)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.orientation (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:orientation: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "orientation", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:orientation: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Orientation)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.orientation (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:orientation: ", p), err) } + return err } func (p *TFetchResultsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "maxRows", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:maxRows: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(p.MaxRows)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxRows (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:maxRows: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "maxRows", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:maxRows: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.MaxRows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxRows (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:maxRows: ", p), err) } + return err } func (p *TFetchResultsReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetFetchType() { - if err := oprot.WriteFieldBegin(ctx, "fetchType", thrift.I16, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fetchType: ", p), err) - } - if err := oprot.WriteI16(ctx, int16(p.FetchType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.fetchType (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fetchType: ", p), err) - } - } - return err + if p.IsSetFetchType() { + if err := oprot.WriteFieldBegin(ctx, "fetchType", thrift.I16, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fetchType: ", p), err) } + if err := oprot.WriteI16(ctx, int16(p.FetchType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fetchType (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fetchType: ", p), err) } + } + return err } func (p *TFetchResultsReq) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetMaxBytes() { - if err := oprot.WriteFieldBegin(ctx, "maxBytes", thrift.I64, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:maxBytes: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.MaxBytes)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxBytes (1281) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:maxBytes: ", p), err) - } - } - return err + if p.IsSetMaxBytes() { + if err := oprot.WriteFieldBegin(ctx, "maxBytes", thrift.I64, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:maxBytes: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.MaxBytes)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxBytes (1281) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:maxBytes: ", p), err) } + } + return err } func (p *TFetchResultsReq) writeField1282(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetStartRowOffset() { - if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 1282); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:startRowOffset: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(*p.StartRowOffset)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (1282) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:startRowOffset: ", p), err) - } - } - return err + if p.IsSetStartRowOffset() { + if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 1282); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1282:startRowOffset: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.StartRowOffset)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (1282) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1282:startRowOffset: ", p), err) } + } + return err } func (p *TFetchResultsReq) writeField1283(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetIncludeResultSetMetadata() { - if err := oprot.WriteFieldBegin(ctx, "includeResultSetMetadata", thrift.BOOL, 1283); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:includeResultSetMetadata: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.IncludeResultSetMetadata)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.includeResultSetMetadata (1283) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:includeResultSetMetadata: ", p), err) - } - } - return err + if p.IsSetIncludeResultSetMetadata() { + if err := oprot.WriteFieldBegin(ctx, "includeResultSetMetadata", thrift.BOOL, 1283); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1283:includeResultSetMetadata: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.IncludeResultSetMetadata)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.includeResultSetMetadata (1283) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1283:includeResultSetMetadata: ", p), err) } + } + return err } func (p *TFetchResultsReq) Equals(other *TFetchResultsReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.OperationHandle.Equals(other.OperationHandle) { - return false - } - if p.Orientation != other.Orientation { - return false - } - if p.MaxRows != other.MaxRows { - return false - } - if p.FetchType != other.FetchType { - return false - } - if p.MaxBytes != other.MaxBytes { - if p.MaxBytes == nil || other.MaxBytes == nil { - return false - } - if (*p.MaxBytes) != (*other.MaxBytes) { - return false - } - } - if p.StartRowOffset != other.StartRowOffset { - if p.StartRowOffset == nil || other.StartRowOffset == nil { - return false - } - if (*p.StartRowOffset) != (*other.StartRowOffset) { - return false - } - } - if p.IncludeResultSetMetadata != other.IncludeResultSetMetadata { - if p.IncludeResultSetMetadata == nil || other.IncludeResultSetMetadata == nil { - return false - } - if (*p.IncludeResultSetMetadata) != (*other.IncludeResultSetMetadata) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if p.Orientation != other.Orientation { return false } + if p.MaxRows != other.MaxRows { return false } + if p.FetchType != other.FetchType { return false } + if p.MaxBytes != other.MaxBytes { + if p.MaxBytes == nil || other.MaxBytes == nil { + return false + } + if (*p.MaxBytes) != (*other.MaxBytes) { return false } + } + if p.StartRowOffset != other.StartRowOffset { + if p.StartRowOffset == nil || other.StartRowOffset == nil { + return false + } + if (*p.StartRowOffset) != (*other.StartRowOffset) { return false } + } + if p.IncludeResultSetMetadata != other.IncludeResultSetMetadata { + if p.IncludeResultSetMetadata == nil || other.IncludeResultSetMetadata == nil { + return false + } + if (*p.IncludeResultSetMetadata) != (*other.IncludeResultSetMetadata) { return false } + } + return true } func (p *TFetchResultsReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TFetchResultsReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TFetchResultsReq(%+v)", *p) } func (p *TFetchResultsReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - HasMoreRows -// - Results -// - ResultSetMetadata +// - Status +// - HasMoreRows +// - Results +// - ResultSetMetadata type TFetchResultsResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - HasMoreRows *bool `thrift:"hasMoreRows,2" db:"hasMoreRows" json:"hasMoreRows,omitempty"` - Results *TRowSet `thrift:"results,3" db:"results" json:"results,omitempty"` - // unused fields # 4 to 1280 - ResultSetMetadata *TGetResultSetMetadataResp `thrift:"resultSetMetadata,1281" db:"resultSetMetadata" json:"resultSetMetadata,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + HasMoreRows *bool `thrift:"hasMoreRows,2" db:"hasMoreRows" json:"hasMoreRows,omitempty"` + Results *TRowSet `thrift:"results,3" db:"results" json:"results,omitempty"` + // unused fields # 4 to 1280 + ResultSetMetadata *TGetResultSetMetadataResp `thrift:"resultSetMetadata,1281" db:"resultSetMetadata" json:"resultSetMetadata,omitempty"` } func NewTFetchResultsResp() *TFetchResultsResp { - return &TFetchResultsResp{} + return &TFetchResultsResp{} } var TFetchResultsResp_Status_DEFAULT *TStatus - func (p *TFetchResultsResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TFetchResultsResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TFetchResultsResp_Status_DEFAULT + } +return p.Status } - var TFetchResultsResp_HasMoreRows_DEFAULT bool - func (p *TFetchResultsResp) GetHasMoreRows() bool { - if !p.IsSetHasMoreRows() { - return TFetchResultsResp_HasMoreRows_DEFAULT - } - return *p.HasMoreRows + if !p.IsSetHasMoreRows() { + return TFetchResultsResp_HasMoreRows_DEFAULT + } +return *p.HasMoreRows } - var TFetchResultsResp_Results_DEFAULT *TRowSet - func (p *TFetchResultsResp) GetResults() *TRowSet { - if !p.IsSetResults() { - return TFetchResultsResp_Results_DEFAULT - } - return p.Results + if !p.IsSetResults() { + return TFetchResultsResp_Results_DEFAULT + } +return p.Results } - var TFetchResultsResp_ResultSetMetadata_DEFAULT *TGetResultSetMetadataResp - func (p *TFetchResultsResp) GetResultSetMetadata() *TGetResultSetMetadataResp { - if !p.IsSetResultSetMetadata() { - return TFetchResultsResp_ResultSetMetadata_DEFAULT - } - return p.ResultSetMetadata + if !p.IsSetResultSetMetadata() { + return TFetchResultsResp_ResultSetMetadata_DEFAULT + } +return p.ResultSetMetadata } func (p *TFetchResultsResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TFetchResultsResp) IsSetHasMoreRows() bool { - return p.HasMoreRows != nil + return p.HasMoreRows != nil } func (p *TFetchResultsResp) IsSetResults() bool { - return p.Results != nil + return p.Results != nil } func (p *TFetchResultsResp) IsSetResultSetMetadata() bool { - return p.ResultSetMetadata != nil + return p.ResultSetMetadata != nil } func (p *TFetchResultsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 1281: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1281(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TFetchResultsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TFetchResultsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.HasMoreRows = &v - } - return nil -} - -func (p *TFetchResultsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - p.Results = &TRowSet{} - if err := p.Results.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Results), err) - } - return nil -} - -func (p *TFetchResultsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { - p.ResultSetMetadata = &TGetResultSetMetadataResp{} - if err := p.ResultSetMetadata.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ResultSetMetadata), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 1281: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1281(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TFetchResultsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TFetchResultsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.HasMoreRows = &v +} + return nil +} + +func (p *TFetchResultsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Results = &TRowSet{} + if err := p.Results.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Results), err) + } + return nil +} + +func (p *TFetchResultsResp) ReadField1281(ctx context.Context, iprot thrift.TProtocol) error { + p.ResultSetMetadata = &TGetResultSetMetadataResp{} + if err := p.ResultSetMetadata.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ResultSetMetadata), err) + } + return nil } func (p *TFetchResultsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TFetchResultsResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField1281(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TFetchResultsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField1281(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TFetchResultsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TFetchResultsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetHasMoreRows() { - if err := oprot.WriteFieldBegin(ctx, "hasMoreRows", thrift.BOOL, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hasMoreRows: ", p), err) - } - if err := oprot.WriteBool(ctx, bool(*p.HasMoreRows)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.hasMoreRows (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hasMoreRows: ", p), err) - } - } - return err + if p.IsSetHasMoreRows() { + if err := oprot.WriteFieldBegin(ctx, "hasMoreRows", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hasMoreRows: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.HasMoreRows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hasMoreRows (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hasMoreRows: ", p), err) } + } + return err } func (p *TFetchResultsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResults() { - if err := oprot.WriteFieldBegin(ctx, "results", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:results: ", p), err) - } - if err := p.Results.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Results), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:results: ", p), err) - } - } - return err + if p.IsSetResults() { + if err := oprot.WriteFieldBegin(ctx, "results", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:results: ", p), err) } + if err := p.Results.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Results), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:results: ", p), err) } + } + return err } func (p *TFetchResultsResp) writeField1281(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetResultSetMetadata() { - if err := oprot.WriteFieldBegin(ctx, "resultSetMetadata", thrift.STRUCT, 1281); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:resultSetMetadata: ", p), err) - } - if err := p.ResultSetMetadata.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ResultSetMetadata), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:resultSetMetadata: ", p), err) - } - } - return err + if p.IsSetResultSetMetadata() { + if err := oprot.WriteFieldBegin(ctx, "resultSetMetadata", thrift.STRUCT, 1281); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1281:resultSetMetadata: ", p), err) } + if err := p.ResultSetMetadata.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ResultSetMetadata), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1281:resultSetMetadata: ", p), err) } + } + return err } func (p *TFetchResultsResp) Equals(other *TFetchResultsResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if p.HasMoreRows != other.HasMoreRows { - if p.HasMoreRows == nil || other.HasMoreRows == nil { - return false - } - if (*p.HasMoreRows) != (*other.HasMoreRows) { - return false - } - } - if !p.Results.Equals(other.Results) { - return false - } - if !p.ResultSetMetadata.Equals(other.ResultSetMetadata) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if p.HasMoreRows != other.HasMoreRows { + if p.HasMoreRows == nil || other.HasMoreRows == nil { + return false + } + if (*p.HasMoreRows) != (*other.HasMoreRows) { return false } + } + if !p.Results.Equals(other.Results) { return false } + if !p.ResultSetMetadata.Equals(other.ResultSetMetadata) { return false } + return true } func (p *TFetchResultsResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TFetchResultsResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TFetchResultsResp(%+v)", *p) } func (p *TFetchResultsResp) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - Owner -// - Renewer +// - SessionHandle +// - Owner +// - Renewer type TGetDelegationTokenReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - Owner string `thrift:"owner,2,required" db:"owner" json:"owner"` - Renewer string `thrift:"renewer,3,required" db:"renewer" json:"renewer"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + Owner string `thrift:"owner,2,required" db:"owner" json:"owner"` + Renewer string `thrift:"renewer,3,required" db:"renewer" json:"renewer"` } func NewTGetDelegationTokenReq() *TGetDelegationTokenReq { - return &TGetDelegationTokenReq{} + return &TGetDelegationTokenReq{} } var TGetDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TGetDelegationTokenReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetDelegationTokenReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TGetDelegationTokenReq_SessionHandle_DEFAULT + } +return p.SessionHandle } func (p *TGetDelegationTokenReq) GetOwner() string { - return p.Owner + return p.Owner } func (p *TGetDelegationTokenReq) GetRenewer() string { - return p.Renewer + return p.Renewer } func (p *TGetDelegationTokenReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TGetDelegationTokenReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - var issetOwner bool = false - var issetRenewer bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetOwner = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetRenewer = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - if !issetOwner { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Owner is not set")) - } - if !issetRenewer { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Renewer is not set")) - } - return nil -} - -func (p *TGetDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TGetDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Owner = v - } - return nil -} - -func (p *TGetDelegationTokenReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.Renewer = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + var issetOwner bool = false; + var issetRenewer bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetOwner = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetRenewer = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + if !issetOwner{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Owner is not set")); + } + if !issetRenewer{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Renewer is not set")); + } + return nil +} + +func (p *TGetDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Owner = v +} + return nil +} + +func (p *TGetDelegationTokenReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Renewer = v +} + return nil } func (p *TGetDelegationTokenReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetDelegationTokenReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetDelegationTokenReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetDelegationTokenReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TGetDelegationTokenReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "owner", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:owner: ", p), err) - } - if err := oprot.WriteString(ctx, string(p.Owner)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.owner (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:owner: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "owner", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:owner: ", p), err) } + if err := oprot.WriteString(ctx, string(p.Owner)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.owner (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:owner: ", p), err) } + return err } func (p *TGetDelegationTokenReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "renewer", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:renewer: ", p), err) - } - if err := oprot.WriteString(ctx, string(p.Renewer)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.renewer (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:renewer: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "renewer", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:renewer: ", p), err) } + if err := oprot.WriteString(ctx, string(p.Renewer)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.renewer (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:renewer: ", p), err) } + return err } func (p *TGetDelegationTokenReq) Equals(other *TGetDelegationTokenReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if p.Owner != other.Owner { - return false - } - if p.Renewer != other.Renewer { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.Owner != other.Owner { return false } + if p.Renewer != other.Renewer { return false } + return true } func (p *TGetDelegationTokenReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetDelegationTokenReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetDelegationTokenReq(%+v)", *p) } func (p *TGetDelegationTokenReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status -// - DelegationToken +// - Status +// - DelegationToken type TGetDelegationTokenResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - DelegationToken *string `thrift:"delegationToken,2" db:"delegationToken" json:"delegationToken,omitempty"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + DelegationToken *string `thrift:"delegationToken,2" db:"delegationToken" json:"delegationToken,omitempty"` } func NewTGetDelegationTokenResp() *TGetDelegationTokenResp { - return &TGetDelegationTokenResp{} + return &TGetDelegationTokenResp{} } var TGetDelegationTokenResp_Status_DEFAULT *TStatus - func (p *TGetDelegationTokenResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetDelegationTokenResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TGetDelegationTokenResp_Status_DEFAULT + } +return p.Status } - var TGetDelegationTokenResp_DelegationToken_DEFAULT string - func (p *TGetDelegationTokenResp) GetDelegationToken() string { - if !p.IsSetDelegationToken() { - return TGetDelegationTokenResp_DelegationToken_DEFAULT - } - return *p.DelegationToken + if !p.IsSetDelegationToken() { + return TGetDelegationTokenResp_DelegationToken_DEFAULT + } +return *p.DelegationToken } func (p *TGetDelegationTokenResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TGetDelegationTokenResp) IsSetDelegationToken() bool { - return p.DelegationToken != nil + return p.DelegationToken != nil } func (p *TGetDelegationTokenResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TGetDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil -} - -func (p *TGetDelegationTokenResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.DelegationToken = &v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetDelegationTokenResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.DelegationToken = &v +} + return nil } func (p *TGetDelegationTokenResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TGetDelegationTokenResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TGetDelegationTokenResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TGetDelegationTokenResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TGetDelegationTokenResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetDelegationToken() { - if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) - } - if err := oprot.WriteString(ctx, string(*p.DelegationToken)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) - } - } - return err + if p.IsSetDelegationToken() { + if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.DelegationToken)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } + } + return err } func (p *TGetDelegationTokenResp) Equals(other *TGetDelegationTokenResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - if p.DelegationToken != other.DelegationToken { - if p.DelegationToken == nil || other.DelegationToken == nil { - return false - } - if (*p.DelegationToken) != (*other.DelegationToken) { - return false - } - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if p.DelegationToken != other.DelegationToken { + if p.DelegationToken == nil || other.DelegationToken == nil { + return false + } + if (*p.DelegationToken) != (*other.DelegationToken) { return false } + } + return true } func (p *TGetDelegationTokenResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetDelegationTokenResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TGetDelegationTokenResp(%+v)", *p) } func (p *TGetDelegationTokenResp) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - DelegationToken +// - SessionHandle +// - DelegationToken type TCancelDelegationTokenReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"` } func NewTCancelDelegationTokenReq() *TCancelDelegationTokenReq { - return &TCancelDelegationTokenReq{} + return &TCancelDelegationTokenReq{} } var TCancelDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TCancelDelegationTokenReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TCancelDelegationTokenReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TCancelDelegationTokenReq_SessionHandle_DEFAULT + } +return p.SessionHandle } func (p *TCancelDelegationTokenReq) GetDelegationToken() string { - return p.DelegationToken + return p.DelegationToken } func (p *TCancelDelegationTokenReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TCancelDelegationTokenReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - var issetDelegationToken bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetDelegationToken = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - if !issetDelegationToken { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set")) - } - return nil -} - -func (p *TCancelDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TCancelDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.DelegationToken = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + var issetDelegationToken bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetDelegationToken = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + if !issetDelegationToken{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set")); + } + return nil +} + +func (p *TCancelDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TCancelDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.DelegationToken = v +} + return nil } func (p *TCancelDelegationTokenReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCancelDelegationTokenReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TCancelDelegationTokenReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCancelDelegationTokenReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TCancelDelegationTokenReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) - } - if err := oprot.WriteString(ctx, string(p.DelegationToken)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } + if err := oprot.WriteString(ctx, string(p.DelegationToken)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } + return err } func (p *TCancelDelegationTokenReq) Equals(other *TCancelDelegationTokenReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if p.DelegationToken != other.DelegationToken { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.DelegationToken != other.DelegationToken { return false } + return true } func (p *TCancelDelegationTokenReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCancelDelegationTokenReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCancelDelegationTokenReq(%+v)", *p) } func (p *TCancelDelegationTokenReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status +// - Status type TCancelDelegationTokenResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTCancelDelegationTokenResp() *TCancelDelegationTokenResp { - return &TCancelDelegationTokenResp{} + return &TCancelDelegationTokenResp{} } var TCancelDelegationTokenResp_Status_DEFAULT *TStatus - func (p *TCancelDelegationTokenResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCancelDelegationTokenResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TCancelDelegationTokenResp_Status_DEFAULT + } +return p.Status } func (p *TCancelDelegationTokenResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TCancelDelegationTokenResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TCancelDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TCancelDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil } func (p *TCancelDelegationTokenResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TCancelDelegationTokenResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TCancelDelegationTokenResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCancelDelegationTokenResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TCancelDelegationTokenResp) Equals(other *TCancelDelegationTokenResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + return true } func (p *TCancelDelegationTokenResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCancelDelegationTokenResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCancelDelegationTokenResp(%+v)", *p) } func (p *TCancelDelegationTokenResp) Validate() error { - return nil + return nil } - // Attributes: -// - SessionHandle -// - DelegationToken +// - SessionHandle +// - DelegationToken type TRenewDelegationTokenReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"` + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"` } func NewTRenewDelegationTokenReq() *TRenewDelegationTokenReq { - return &TRenewDelegationTokenReq{} + return &TRenewDelegationTokenReq{} } var TRenewDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle - func (p *TRenewDelegationTokenReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TRenewDelegationTokenReq_SessionHandle_DEFAULT - } - return p.SessionHandle + if !p.IsSetSessionHandle() { + return TRenewDelegationTokenReq_SessionHandle_DEFAULT + } +return p.SessionHandle } func (p *TRenewDelegationTokenReq) GetDelegationToken() string { - return p.DelegationToken + return p.DelegationToken } func (p *TRenewDelegationTokenReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil + return p.SessionHandle != nil } func (p *TRenewDelegationTokenReq) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetSessionHandle bool = false - var issetDelegationToken bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetDelegationToken = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetSessionHandle { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")) - } - if !issetDelegationToken { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set")) - } - return nil -} - -func (p *TRenewDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) - } - return nil -} - -func (p *TRenewDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.DelegationToken = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + var issetDelegationToken bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetDelegationToken = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + if !issetDelegationToken{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set")); + } + return nil +} + +func (p *TRenewDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TRenewDelegationTokenReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.DelegationToken = v +} + return nil } func (p *TRenewDelegationTokenReq) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TRenewDelegationTokenReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TRenewDelegationTokenReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TRenewDelegationTokenReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) - } - if err := p.SessionHandle.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err } func (p *TRenewDelegationTokenReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) - } - if err := oprot.WriteString(ctx, string(p.DelegationToken)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } + if err := oprot.WriteString(ctx, string(p.DelegationToken)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } + return err } func (p *TRenewDelegationTokenReq) Equals(other *TRenewDelegationTokenReq) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.SessionHandle.Equals(other.SessionHandle) { - return false - } - if p.DelegationToken != other.DelegationToken { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.DelegationToken != other.DelegationToken { return false } + return true } func (p *TRenewDelegationTokenReq) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TRenewDelegationTokenReq(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TRenewDelegationTokenReq(%+v)", *p) } func (p *TRenewDelegationTokenReq) Validate() error { - return nil + return nil } - // Attributes: -// - Status +// - Status type TRenewDelegationTokenResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } func NewTRenewDelegationTokenResp() *TRenewDelegationTokenResp { - return &TRenewDelegationTokenResp{} + return &TRenewDelegationTokenResp{} } var TRenewDelegationTokenResp_Status_DEFAULT *TStatus - func (p *TRenewDelegationTokenResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TRenewDelegationTokenResp_Status_DEFAULT - } - return p.Status + if !p.IsSetStatus() { + return TRenewDelegationTokenResp_Status_DEFAULT + } +return p.Status } func (p *TRenewDelegationTokenResp) IsSetStatus() bool { - return p.Status != nil + return p.Status != nil } func (p *TRenewDelegationTokenResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetStatus bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - return nil -} - -func (p *TRenewDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TRenewDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil } func (p *TRenewDelegationTokenResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TRenewDelegationTokenResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TRenewDelegationTokenResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TRenewDelegationTokenResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) - } - if err := p.Status.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } func (p *TRenewDelegationTokenResp) Equals(other *TRenewDelegationTokenResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if !p.Status.Equals(other.Status) { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + return true } func (p *TRenewDelegationTokenResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TRenewDelegationTokenResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TRenewDelegationTokenResp(%+v)", *p) } func (p *TRenewDelegationTokenResp) Validate() error { - return nil + return nil } - // Attributes: -// - HeaderNames -// - Rows -// - ProgressedPercentage -// - Status -// - FooterSummary -// - StartTime +// - HeaderNames +// - Rows +// - ProgressedPercentage +// - Status +// - FooterSummary +// - StartTime type TProgressUpdateResp struct { - HeaderNames []string `thrift:"headerNames,1,required" db:"headerNames" json:"headerNames"` - Rows [][]string `thrift:"rows,2,required" db:"rows" json:"rows"` - ProgressedPercentage float64 `thrift:"progressedPercentage,3,required" db:"progressedPercentage" json:"progressedPercentage"` - Status TJobExecutionStatus `thrift:"status,4,required" db:"status" json:"status"` - FooterSummary string `thrift:"footerSummary,5,required" db:"footerSummary" json:"footerSummary"` - StartTime int64 `thrift:"startTime,6,required" db:"startTime" json:"startTime"` + HeaderNames []string `thrift:"headerNames,1,required" db:"headerNames" json:"headerNames"` + Rows [][]string `thrift:"rows,2,required" db:"rows" json:"rows"` + ProgressedPercentage float64 `thrift:"progressedPercentage,3,required" db:"progressedPercentage" json:"progressedPercentage"` + Status TJobExecutionStatus `thrift:"status,4,required" db:"status" json:"status"` + FooterSummary string `thrift:"footerSummary,5,required" db:"footerSummary" json:"footerSummary"` + StartTime int64 `thrift:"startTime,6,required" db:"startTime" json:"startTime"` } func NewTProgressUpdateResp() *TProgressUpdateResp { - return &TProgressUpdateResp{} + return &TProgressUpdateResp{} } + func (p *TProgressUpdateResp) GetHeaderNames() []string { - return p.HeaderNames + return p.HeaderNames } func (p *TProgressUpdateResp) GetRows() [][]string { - return p.Rows + return p.Rows } func (p *TProgressUpdateResp) GetProgressedPercentage() float64 { - return p.ProgressedPercentage + return p.ProgressedPercentage } func (p *TProgressUpdateResp) GetStatus() TJobExecutionStatus { - return p.Status + return p.Status } func (p *TProgressUpdateResp) GetFooterSummary() string { - return p.FooterSummary + return p.FooterSummary } func (p *TProgressUpdateResp) GetStartTime() int64 { - return p.StartTime + return p.StartTime } func (p *TProgressUpdateResp) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetHeaderNames bool = false - var issetRows bool = false - var issetProgressedPercentage bool = false - var issetStatus bool = false - var issetFooterSummary bool = false - var issetStartTime bool = false - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - issetHeaderNames = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.LIST { - if err := p.ReadField2(ctx, iprot); err != nil { - return err - } - issetRows = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField3(ctx, iprot); err != nil { - return err - } - issetProgressedPercentage = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 4: - if fieldTypeId == thrift.I32 { - if err := p.ReadField4(ctx, iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 5: - if fieldTypeId == thrift.STRING { - if err := p.ReadField5(ctx, iprot); err != nil { - return err - } - issetFooterSummary = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - case 6: - if fieldTypeId == thrift.I64 { - if err := p.ReadField6(ctx, iprot); err != nil { - return err - } - issetStartTime = true - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetHeaderNames { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HeaderNames is not set")) - } - if !issetRows { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")) - } - if !issetProgressedPercentage { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ProgressedPercentage is not set")) - } - if !issetStatus { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")) - } - if !issetFooterSummary { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FooterSummary is not set")) - } - if !issetStartTime { - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartTime is not set")) - } - return nil -} - -func (p *TProgressUpdateResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]string, 0, size) - p.HeaderNames = tSlice - for i := 0; i < size; i++ { - var _elem68 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem68 = v - } - p.HeaderNames = append(p.HeaderNames, _elem68) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TProgressUpdateResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([][]string, 0, size) - p.Rows = tSlice - for i := 0; i < size; i++ { - _, size, err := iprot.ReadListBegin(ctx) - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]string, 0, size) - _elem69 := tSlice - for i := 0; i < size; i++ { - var _elem70 string - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem70 = v - } - _elem69 = append(_elem69, _elem70) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.Rows = append(p.Rows, _elem69) - } - if err := iprot.ReadListEnd(ctx); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *TProgressUpdateResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(ctx); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.ProgressedPercentage = v - } - return nil -} - -func (p *TProgressUpdateResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(ctx); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - temp := TJobExecutionStatus(v) - p.Status = temp - } - return nil -} - -func (p *TProgressUpdateResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(ctx); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - p.FooterSummary = v - } - return nil -} - -func (p *TProgressUpdateResp) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(ctx); err != nil { - return thrift.PrependError("error reading field 6: ", err) - } else { - p.StartTime = v - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetHeaderNames bool = false; + var issetRows bool = false; + var issetProgressedPercentage bool = false; + var issetStatus bool = false; + var issetFooterSummary bool = false; + var issetStartTime bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetHeaderNames = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetRows = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetProgressedPercentage = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + issetFooterSummary = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + issetStartTime = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetHeaderNames{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HeaderNames is not set")); + } + if !issetRows{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")); + } + if !issetProgressedPercentage{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ProgressedPercentage is not set")); + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + if !issetFooterSummary{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FooterSummary is not set")); + } + if !issetStartTime{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartTime is not set")); + } + return nil +} + +func (p *TProgressUpdateResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.HeaderNames = tSlice + for i := 0; i < size; i ++ { +var _elem68 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem68 = v +} + p.HeaderNames = append(p.HeaderNames, _elem68) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TProgressUpdateResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]string, 0, size) + p.Rows = tSlice + for i := 0; i < size; i ++ { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + _elem69 := tSlice + for i := 0; i < size; i ++ { +var _elem70 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem70 = v +} + _elem69 = append(_elem69, _elem70) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Rows = append(p.Rows, _elem69) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TProgressUpdateResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ProgressedPercentage = v +} + return nil +} + +func (p *TProgressUpdateResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := TJobExecutionStatus(v) + p.Status = temp +} + return nil +} + +func (p *TProgressUpdateResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.FooterSummary = v +} + return nil +} + +func (p *TProgressUpdateResp) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StartTime = v +} + return nil } func (p *TProgressUpdateResp) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "TProgressUpdateResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - if err := p.writeField2(ctx, oprot); err != nil { - return err - } - if err := p.writeField3(ctx, oprot); err != nil { - return err - } - if err := p.writeField4(ctx, oprot); err != nil { - return err - } - if err := p.writeField5(ctx, oprot); err != nil { - return err - } - if err := p.writeField6(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "TProgressUpdateResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TProgressUpdateResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "headerNames", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:headerNames: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.HeaderNames)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.HeaderNames { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:headerNames: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "headerNames", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:headerNames: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.HeaderNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.HeaderNames { + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:headerNames: ", p), err) } + return err } func (p *TProgressUpdateResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "rows", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) - } - if err := oprot.WriteListBegin(ctx, thrift.LIST, len(p.Rows)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Rows { - if err := oprot.WriteListBegin(ctx, thrift.STRING, len(v)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range v { - if err := oprot.WriteString(ctx, string(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - } - if err := oprot.WriteListEnd(ctx); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rows: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "rows", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.LIST, len(p.Rows)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Rows { + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rows: ", p), err) } + return err } func (p *TProgressUpdateResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "progressedPercentage", thrift.DOUBLE, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:progressedPercentage: ", p), err) - } - if err := oprot.WriteDouble(ctx, float64(p.ProgressedPercentage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.progressedPercentage (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:progressedPercentage: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "progressedPercentage", thrift.DOUBLE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:progressedPercentage: ", p), err) } + if err := oprot.WriteDouble(ctx, float64(p.ProgressedPercentage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.progressedPercentage (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:progressedPercentage: ", p), err) } + return err } func (p *TProgressUpdateResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "status", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) - } - if err := oprot.WriteI32(ctx, int32(p.Status)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) } + return err } func (p *TProgressUpdateResp) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "footerSummary", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:footerSummary: ", p), err) - } - if err := oprot.WriteString(ctx, string(p.FooterSummary)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.footerSummary (5) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:footerSummary: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "footerSummary", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:footerSummary: ", p), err) } + if err := oprot.WriteString(ctx, string(p.FooterSummary)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.footerSummary (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:footerSummary: ", p), err) } + return err } func (p *TProgressUpdateResp) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "startTime", thrift.I64, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:startTime: ", p), err) - } - if err := oprot.WriteI64(ctx, int64(p.StartTime)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.startTime (6) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:startTime: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "startTime", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:startTime: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.startTime (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:startTime: ", p), err) } + return err } func (p *TProgressUpdateResp) Equals(other *TProgressUpdateResp) bool { - if p == other { - return true - } else if p == nil || other == nil { - return false - } - if len(p.HeaderNames) != len(other.HeaderNames) { - return false - } - for i, _tgt := range p.HeaderNames { - _src71 := other.HeaderNames[i] - if _tgt != _src71 { - return false - } - } - if len(p.Rows) != len(other.Rows) { - return false - } - for i, _tgt := range p.Rows { - _src72 := other.Rows[i] - if len(_tgt) != len(_src72) { - return false - } - for i, _tgt := range _tgt { - _src73 := _src72[i] - if _tgt != _src73 { - return false - } - } - } - if p.ProgressedPercentage != other.ProgressedPercentage { - return false - } - if p.Status != other.Status { - return false - } - if p.FooterSummary != other.FooterSummary { - return false - } - if p.StartTime != other.StartTime { - return false - } - return true + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.HeaderNames) != len(other.HeaderNames) { return false } + for i, _tgt := range p.HeaderNames { + _src71 := other.HeaderNames[i] + if _tgt != _src71 { return false } + } + if len(p.Rows) != len(other.Rows) { return false } + for i, _tgt := range p.Rows { + _src72 := other.Rows[i] + if len(_tgt) != len(_src72) { return false } + for i, _tgt := range _tgt { + _src73 := _src72[i] + if _tgt != _src73 { return false } + } + } + if p.ProgressedPercentage != other.ProgressedPercentage { return false } + if p.Status != other.Status { return false } + if p.FooterSummary != other.FooterSummary { return false } + if p.StartTime != other.StartTime { return false } + return true } func (p *TProgressUpdateResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TProgressUpdateResp(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TProgressUpdateResp(%+v)", *p) } func (p *TProgressUpdateResp) Validate() error { - return nil + return nil } - type TCLIService interface { - // Parameters: - // - Req - OpenSession(ctx context.Context, req *TOpenSessionReq) (_r *TOpenSessionResp, _err error) - // Parameters: - // - Req - CloseSession(ctx context.Context, req *TCloseSessionReq) (_r *TCloseSessionResp, _err error) - // Parameters: - // - Req - GetInfo(ctx context.Context, req *TGetInfoReq) (_r *TGetInfoResp, _err error) - // Parameters: - // - Req - ExecuteStatement(ctx context.Context, req *TExecuteStatementReq) (_r *TExecuteStatementResp, _err error) - // Parameters: - // - Req - GetTypeInfo(ctx context.Context, req *TGetTypeInfoReq) (_r *TGetTypeInfoResp, _err error) - // Parameters: - // - Req - GetCatalogs(ctx context.Context, req *TGetCatalogsReq) (_r *TGetCatalogsResp, _err error) - // Parameters: - // - Req - GetSchemas(ctx context.Context, req *TGetSchemasReq) (_r *TGetSchemasResp, _err error) - // Parameters: - // - Req - GetTables(ctx context.Context, req *TGetTablesReq) (_r *TGetTablesResp, _err error) - // Parameters: - // - Req - GetTableTypes(ctx context.Context, req *TGetTableTypesReq) (_r *TGetTableTypesResp, _err error) - // Parameters: - // - Req - GetColumns(ctx context.Context, req *TGetColumnsReq) (_r *TGetColumnsResp, _err error) - // Parameters: - // - Req - GetFunctions(ctx context.Context, req *TGetFunctionsReq) (_r *TGetFunctionsResp, _err error) - // Parameters: - // - Req - GetPrimaryKeys(ctx context.Context, req *TGetPrimaryKeysReq) (_r *TGetPrimaryKeysResp, _err error) - // Parameters: - // - Req - GetCrossReference(ctx context.Context, req *TGetCrossReferenceReq) (_r *TGetCrossReferenceResp, _err error) - // Parameters: - // - Req - GetOperationStatus(ctx context.Context, req *TGetOperationStatusReq) (_r *TGetOperationStatusResp, _err error) - // Parameters: - // - Req - CancelOperation(ctx context.Context, req *TCancelOperationReq) (_r *TCancelOperationResp, _err error) - // Parameters: - // - Req - CloseOperation(ctx context.Context, req *TCloseOperationReq) (_r *TCloseOperationResp, _err error) - // Parameters: - // - Req - GetResultSetMetadata(ctx context.Context, req *TGetResultSetMetadataReq) (_r *TGetResultSetMetadataResp, _err error) - // Parameters: - // - Req - FetchResults(ctx context.Context, req *TFetchResultsReq) (_r *TFetchResultsResp, _err error) - // Parameters: - // - Req - GetDelegationToken(ctx context.Context, req *TGetDelegationTokenReq) (_r *TGetDelegationTokenResp, _err error) - // Parameters: - // - Req - CancelDelegationToken(ctx context.Context, req *TCancelDelegationTokenReq) (_r *TCancelDelegationTokenResp, _err error) - // Parameters: - // - Req - RenewDelegationToken(ctx context.Context, req *TRenewDelegationTokenReq) (_r *TRenewDelegationTokenResp, _err error) + // Parameters: + // - Req + OpenSession(ctx context.Context, req *TOpenSessionReq) (_r *TOpenSessionResp, _err error) + // Parameters: + // - Req + CloseSession(ctx context.Context, req *TCloseSessionReq) (_r *TCloseSessionResp, _err error) + // Parameters: + // - Req + GetInfo(ctx context.Context, req *TGetInfoReq) (_r *TGetInfoResp, _err error) + // Parameters: + // - Req + ExecuteStatement(ctx context.Context, req *TExecuteStatementReq) (_r *TExecuteStatementResp, _err error) + // Parameters: + // - Req + GetTypeInfo(ctx context.Context, req *TGetTypeInfoReq) (_r *TGetTypeInfoResp, _err error) + // Parameters: + // - Req + GetCatalogs(ctx context.Context, req *TGetCatalogsReq) (_r *TGetCatalogsResp, _err error) + // Parameters: + // - Req + GetSchemas(ctx context.Context, req *TGetSchemasReq) (_r *TGetSchemasResp, _err error) + // Parameters: + // - Req + GetTables(ctx context.Context, req *TGetTablesReq) (_r *TGetTablesResp, _err error) + // Parameters: + // - Req + GetTableTypes(ctx context.Context, req *TGetTableTypesReq) (_r *TGetTableTypesResp, _err error) + // Parameters: + // - Req + GetColumns(ctx context.Context, req *TGetColumnsReq) (_r *TGetColumnsResp, _err error) + // Parameters: + // - Req + GetFunctions(ctx context.Context, req *TGetFunctionsReq) (_r *TGetFunctionsResp, _err error) + // Parameters: + // - Req + GetPrimaryKeys(ctx context.Context, req *TGetPrimaryKeysReq) (_r *TGetPrimaryKeysResp, _err error) + // Parameters: + // - Req + GetCrossReference(ctx context.Context, req *TGetCrossReferenceReq) (_r *TGetCrossReferenceResp, _err error) + // Parameters: + // - Req + GetOperationStatus(ctx context.Context, req *TGetOperationStatusReq) (_r *TGetOperationStatusResp, _err error) + // Parameters: + // - Req + CancelOperation(ctx context.Context, req *TCancelOperationReq) (_r *TCancelOperationResp, _err error) + // Parameters: + // - Req + CloseOperation(ctx context.Context, req *TCloseOperationReq) (_r *TCloseOperationResp, _err error) + // Parameters: + // - Req + GetResultSetMetadata(ctx context.Context, req *TGetResultSetMetadataReq) (_r *TGetResultSetMetadataResp, _err error) + // Parameters: + // - Req + FetchResults(ctx context.Context, req *TFetchResultsReq) (_r *TFetchResultsResp, _err error) + // Parameters: + // - Req + GetDelegationToken(ctx context.Context, req *TGetDelegationTokenReq) (_r *TGetDelegationTokenResp, _err error) + // Parameters: + // - Req + CancelDelegationToken(ctx context.Context, req *TCancelDelegationTokenReq) (_r *TCancelDelegationTokenResp, _err error) + // Parameters: + // - Req + RenewDelegationToken(ctx context.Context, req *TRenewDelegationTokenReq) (_r *TRenewDelegationTokenResp, _err error) } type TCLIServiceClient struct { - c thrift.TClient - meta thrift.ResponseMeta + c thrift.TClient + meta thrift.ResponseMeta } func NewTCLIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *TCLIServiceClient { - return &TCLIServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), - } + return &TCLIServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } } func NewTCLIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *TCLIServiceClient { - return &TCLIServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), - } + return &TCLIServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } } func NewTCLIServiceClient(c thrift.TClient) *TCLIServiceClient { - return &TCLIServiceClient{ - c: c, - } + return &TCLIServiceClient{ + c: c, + } } func (p *TCLIServiceClient) Client_() thrift.TClient { - return p.c + return p.c } func (p *TCLIServiceClient) LastResponseMeta_() thrift.ResponseMeta { - return p.meta + return p.meta } func (p *TCLIServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { - p.meta = meta + p.meta = meta } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) OpenSession(ctx context.Context, req *TOpenSessionReq) (_r *TOpenSessionResp, _err error) { - var _args74 TCLIServiceOpenSessionArgs - _args74.Req = req - var _result76 TCLIServiceOpenSessionResult - var _meta75 thrift.ResponseMeta - _meta75, _err = p.Client_().Call(ctx, "OpenSession", &_args74, &_result76) - p.SetLastResponseMeta_(_meta75) - if _err != nil { - return - } - if _ret77 := _result76.GetSuccess(); _ret77 != nil { - return _ret77, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "OpenSession failed: unknown result") + var _args74 TCLIServiceOpenSessionArgs + _args74.Req = req + var _result76 TCLIServiceOpenSessionResult + var _meta75 thrift.ResponseMeta + _meta75, _err = p.Client_().Call(ctx, "OpenSession", &_args74, &_result76) + p.SetLastResponseMeta_(_meta75) + if _err != nil { + return + } + if _ret77 := _result76.GetSuccess(); _ret77 != nil { + return _ret77, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "OpenSession failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) CloseSession(ctx context.Context, req *TCloseSessionReq) (_r *TCloseSessionResp, _err error) { - var _args78 TCLIServiceCloseSessionArgs - _args78.Req = req - var _result80 TCLIServiceCloseSessionResult - var _meta79 thrift.ResponseMeta - _meta79, _err = p.Client_().Call(ctx, "CloseSession", &_args78, &_result80) - p.SetLastResponseMeta_(_meta79) - if _err != nil { - return - } - if _ret81 := _result80.GetSuccess(); _ret81 != nil { - return _ret81, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CloseSession failed: unknown result") + var _args78 TCLIServiceCloseSessionArgs + _args78.Req = req + var _result80 TCLIServiceCloseSessionResult + var _meta79 thrift.ResponseMeta + _meta79, _err = p.Client_().Call(ctx, "CloseSession", &_args78, &_result80) + p.SetLastResponseMeta_(_meta79) + if _err != nil { + return + } + if _ret81 := _result80.GetSuccess(); _ret81 != nil { + return _ret81, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CloseSession failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetInfo(ctx context.Context, req *TGetInfoReq) (_r *TGetInfoResp, _err error) { - var _args82 TCLIServiceGetInfoArgs - _args82.Req = req - var _result84 TCLIServiceGetInfoResult - var _meta83 thrift.ResponseMeta - _meta83, _err = p.Client_().Call(ctx, "GetInfo", &_args82, &_result84) - p.SetLastResponseMeta_(_meta83) - if _err != nil { - return - } - if _ret85 := _result84.GetSuccess(); _ret85 != nil { - return _ret85, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetInfo failed: unknown result") + var _args82 TCLIServiceGetInfoArgs + _args82.Req = req + var _result84 TCLIServiceGetInfoResult + var _meta83 thrift.ResponseMeta + _meta83, _err = p.Client_().Call(ctx, "GetInfo", &_args82, &_result84) + p.SetLastResponseMeta_(_meta83) + if _err != nil { + return + } + if _ret85 := _result84.GetSuccess(); _ret85 != nil { + return _ret85, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetInfo failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) ExecuteStatement(ctx context.Context, req *TExecuteStatementReq) (_r *TExecuteStatementResp, _err error) { - var _args86 TCLIServiceExecuteStatementArgs - _args86.Req = req - var _result88 TCLIServiceExecuteStatementResult - var _meta87 thrift.ResponseMeta - _meta87, _err = p.Client_().Call(ctx, "ExecuteStatement", &_args86, &_result88) - p.SetLastResponseMeta_(_meta87) - if _err != nil { - return - } - if _ret89 := _result88.GetSuccess(); _ret89 != nil { - return _ret89, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "ExecuteStatement failed: unknown result") + var _args86 TCLIServiceExecuteStatementArgs + _args86.Req = req + var _result88 TCLIServiceExecuteStatementResult + var _meta87 thrift.ResponseMeta + _meta87, _err = p.Client_().Call(ctx, "ExecuteStatement", &_args86, &_result88) + p.SetLastResponseMeta_(_meta87) + if _err != nil { + return + } + if _ret89 := _result88.GetSuccess(); _ret89 != nil { + return _ret89, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "ExecuteStatement failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetTypeInfo(ctx context.Context, req *TGetTypeInfoReq) (_r *TGetTypeInfoResp, _err error) { - var _args90 TCLIServiceGetTypeInfoArgs - _args90.Req = req - var _result92 TCLIServiceGetTypeInfoResult - var _meta91 thrift.ResponseMeta - _meta91, _err = p.Client_().Call(ctx, "GetTypeInfo", &_args90, &_result92) - p.SetLastResponseMeta_(_meta91) - if _err != nil { - return - } - if _ret93 := _result92.GetSuccess(); _ret93 != nil { - return _ret93, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetTypeInfo failed: unknown result") + var _args90 TCLIServiceGetTypeInfoArgs + _args90.Req = req + var _result92 TCLIServiceGetTypeInfoResult + var _meta91 thrift.ResponseMeta + _meta91, _err = p.Client_().Call(ctx, "GetTypeInfo", &_args90, &_result92) + p.SetLastResponseMeta_(_meta91) + if _err != nil { + return + } + if _ret93 := _result92.GetSuccess(); _ret93 != nil { + return _ret93, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetTypeInfo failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetCatalogs(ctx context.Context, req *TGetCatalogsReq) (_r *TGetCatalogsResp, _err error) { - var _args94 TCLIServiceGetCatalogsArgs - _args94.Req = req - var _result96 TCLIServiceGetCatalogsResult - var _meta95 thrift.ResponseMeta - _meta95, _err = p.Client_().Call(ctx, "GetCatalogs", &_args94, &_result96) - p.SetLastResponseMeta_(_meta95) - if _err != nil { - return - } - if _ret97 := _result96.GetSuccess(); _ret97 != nil { - return _ret97, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetCatalogs failed: unknown result") + var _args94 TCLIServiceGetCatalogsArgs + _args94.Req = req + var _result96 TCLIServiceGetCatalogsResult + var _meta95 thrift.ResponseMeta + _meta95, _err = p.Client_().Call(ctx, "GetCatalogs", &_args94, &_result96) + p.SetLastResponseMeta_(_meta95) + if _err != nil { + return + } + if _ret97 := _result96.GetSuccess(); _ret97 != nil { + return _ret97, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetCatalogs failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetSchemas(ctx context.Context, req *TGetSchemasReq) (_r *TGetSchemasResp, _err error) { - var _args98 TCLIServiceGetSchemasArgs - _args98.Req = req - var _result100 TCLIServiceGetSchemasResult - var _meta99 thrift.ResponseMeta - _meta99, _err = p.Client_().Call(ctx, "GetSchemas", &_args98, &_result100) - p.SetLastResponseMeta_(_meta99) - if _err != nil { - return - } - if _ret101 := _result100.GetSuccess(); _ret101 != nil { - return _ret101, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetSchemas failed: unknown result") + var _args98 TCLIServiceGetSchemasArgs + _args98.Req = req + var _result100 TCLIServiceGetSchemasResult + var _meta99 thrift.ResponseMeta + _meta99, _err = p.Client_().Call(ctx, "GetSchemas", &_args98, &_result100) + p.SetLastResponseMeta_(_meta99) + if _err != nil { + return + } + if _ret101 := _result100.GetSuccess(); _ret101 != nil { + return _ret101, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetSchemas failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetTables(ctx context.Context, req *TGetTablesReq) (_r *TGetTablesResp, _err error) { - var _args102 TCLIServiceGetTablesArgs - _args102.Req = req - var _result104 TCLIServiceGetTablesResult - var _meta103 thrift.ResponseMeta - _meta103, _err = p.Client_().Call(ctx, "GetTables", &_args102, &_result104) - p.SetLastResponseMeta_(_meta103) - if _err != nil { - return - } - if _ret105 := _result104.GetSuccess(); _ret105 != nil { - return _ret105, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetTables failed: unknown result") + var _args102 TCLIServiceGetTablesArgs + _args102.Req = req + var _result104 TCLIServiceGetTablesResult + var _meta103 thrift.ResponseMeta + _meta103, _err = p.Client_().Call(ctx, "GetTables", &_args102, &_result104) + p.SetLastResponseMeta_(_meta103) + if _err != nil { + return + } + if _ret105 := _result104.GetSuccess(); _ret105 != nil { + return _ret105, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetTables failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetTableTypes(ctx context.Context, req *TGetTableTypesReq) (_r *TGetTableTypesResp, _err error) { - var _args106 TCLIServiceGetTableTypesArgs - _args106.Req = req - var _result108 TCLIServiceGetTableTypesResult - var _meta107 thrift.ResponseMeta - _meta107, _err = p.Client_().Call(ctx, "GetTableTypes", &_args106, &_result108) - p.SetLastResponseMeta_(_meta107) - if _err != nil { - return - } - if _ret109 := _result108.GetSuccess(); _ret109 != nil { - return _ret109, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetTableTypes failed: unknown result") + var _args106 TCLIServiceGetTableTypesArgs + _args106.Req = req + var _result108 TCLIServiceGetTableTypesResult + var _meta107 thrift.ResponseMeta + _meta107, _err = p.Client_().Call(ctx, "GetTableTypes", &_args106, &_result108) + p.SetLastResponseMeta_(_meta107) + if _err != nil { + return + } + if _ret109 := _result108.GetSuccess(); _ret109 != nil { + return _ret109, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetTableTypes failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetColumns(ctx context.Context, req *TGetColumnsReq) (_r *TGetColumnsResp, _err error) { - var _args110 TCLIServiceGetColumnsArgs - _args110.Req = req - var _result112 TCLIServiceGetColumnsResult - var _meta111 thrift.ResponseMeta - _meta111, _err = p.Client_().Call(ctx, "GetColumns", &_args110, &_result112) - p.SetLastResponseMeta_(_meta111) - if _err != nil { - return - } - if _ret113 := _result112.GetSuccess(); _ret113 != nil { - return _ret113, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetColumns failed: unknown result") + var _args110 TCLIServiceGetColumnsArgs + _args110.Req = req + var _result112 TCLIServiceGetColumnsResult + var _meta111 thrift.ResponseMeta + _meta111, _err = p.Client_().Call(ctx, "GetColumns", &_args110, &_result112) + p.SetLastResponseMeta_(_meta111) + if _err != nil { + return + } + if _ret113 := _result112.GetSuccess(); _ret113 != nil { + return _ret113, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetColumns failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetFunctions(ctx context.Context, req *TGetFunctionsReq) (_r *TGetFunctionsResp, _err error) { - var _args114 TCLIServiceGetFunctionsArgs - _args114.Req = req - var _result116 TCLIServiceGetFunctionsResult - var _meta115 thrift.ResponseMeta - _meta115, _err = p.Client_().Call(ctx, "GetFunctions", &_args114, &_result116) - p.SetLastResponseMeta_(_meta115) - if _err != nil { - return - } - if _ret117 := _result116.GetSuccess(); _ret117 != nil { - return _ret117, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetFunctions failed: unknown result") + var _args114 TCLIServiceGetFunctionsArgs + _args114.Req = req + var _result116 TCLIServiceGetFunctionsResult + var _meta115 thrift.ResponseMeta + _meta115, _err = p.Client_().Call(ctx, "GetFunctions", &_args114, &_result116) + p.SetLastResponseMeta_(_meta115) + if _err != nil { + return + } + if _ret117 := _result116.GetSuccess(); _ret117 != nil { + return _ret117, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetFunctions failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetPrimaryKeys(ctx context.Context, req *TGetPrimaryKeysReq) (_r *TGetPrimaryKeysResp, _err error) { - var _args118 TCLIServiceGetPrimaryKeysArgs - _args118.Req = req - var _result120 TCLIServiceGetPrimaryKeysResult - var _meta119 thrift.ResponseMeta - _meta119, _err = p.Client_().Call(ctx, "GetPrimaryKeys", &_args118, &_result120) - p.SetLastResponseMeta_(_meta119) - if _err != nil { - return - } - if _ret121 := _result120.GetSuccess(); _ret121 != nil { - return _ret121, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetPrimaryKeys failed: unknown result") + var _args118 TCLIServiceGetPrimaryKeysArgs + _args118.Req = req + var _result120 TCLIServiceGetPrimaryKeysResult + var _meta119 thrift.ResponseMeta + _meta119, _err = p.Client_().Call(ctx, "GetPrimaryKeys", &_args118, &_result120) + p.SetLastResponseMeta_(_meta119) + if _err != nil { + return + } + if _ret121 := _result120.GetSuccess(); _ret121 != nil { + return _ret121, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetPrimaryKeys failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetCrossReference(ctx context.Context, req *TGetCrossReferenceReq) (_r *TGetCrossReferenceResp, _err error) { - var _args122 TCLIServiceGetCrossReferenceArgs - _args122.Req = req - var _result124 TCLIServiceGetCrossReferenceResult - var _meta123 thrift.ResponseMeta - _meta123, _err = p.Client_().Call(ctx, "GetCrossReference", &_args122, &_result124) - p.SetLastResponseMeta_(_meta123) - if _err != nil { - return - } - if _ret125 := _result124.GetSuccess(); _ret125 != nil { - return _ret125, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetCrossReference failed: unknown result") + var _args122 TCLIServiceGetCrossReferenceArgs + _args122.Req = req + var _result124 TCLIServiceGetCrossReferenceResult + var _meta123 thrift.ResponseMeta + _meta123, _err = p.Client_().Call(ctx, "GetCrossReference", &_args122, &_result124) + p.SetLastResponseMeta_(_meta123) + if _err != nil { + return + } + if _ret125 := _result124.GetSuccess(); _ret125 != nil { + return _ret125, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetCrossReference failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetOperationStatus(ctx context.Context, req *TGetOperationStatusReq) (_r *TGetOperationStatusResp, _err error) { - var _args126 TCLIServiceGetOperationStatusArgs - _args126.Req = req - var _result128 TCLIServiceGetOperationStatusResult - var _meta127 thrift.ResponseMeta - _meta127, _err = p.Client_().Call(ctx, "GetOperationStatus", &_args126, &_result128) - p.SetLastResponseMeta_(_meta127) - if _err != nil { - return - } - if _ret129 := _result128.GetSuccess(); _ret129 != nil { - return _ret129, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetOperationStatus failed: unknown result") + var _args126 TCLIServiceGetOperationStatusArgs + _args126.Req = req + var _result128 TCLIServiceGetOperationStatusResult + var _meta127 thrift.ResponseMeta + _meta127, _err = p.Client_().Call(ctx, "GetOperationStatus", &_args126, &_result128) + p.SetLastResponseMeta_(_meta127) + if _err != nil { + return + } + if _ret129 := _result128.GetSuccess(); _ret129 != nil { + return _ret129, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetOperationStatus failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) CancelOperation(ctx context.Context, req *TCancelOperationReq) (_r *TCancelOperationResp, _err error) { - var _args130 TCLIServiceCancelOperationArgs - _args130.Req = req - var _result132 TCLIServiceCancelOperationResult - var _meta131 thrift.ResponseMeta - _meta131, _err = p.Client_().Call(ctx, "CancelOperation", &_args130, &_result132) - p.SetLastResponseMeta_(_meta131) - if _err != nil { - return - } - if _ret133 := _result132.GetSuccess(); _ret133 != nil { - return _ret133, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CancelOperation failed: unknown result") + var _args130 TCLIServiceCancelOperationArgs + _args130.Req = req + var _result132 TCLIServiceCancelOperationResult + var _meta131 thrift.ResponseMeta + _meta131, _err = p.Client_().Call(ctx, "CancelOperation", &_args130, &_result132) + p.SetLastResponseMeta_(_meta131) + if _err != nil { + return + } + if _ret133 := _result132.GetSuccess(); _ret133 != nil { + return _ret133, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CancelOperation failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) CloseOperation(ctx context.Context, req *TCloseOperationReq) (_r *TCloseOperationResp, _err error) { - var _args134 TCLIServiceCloseOperationArgs - _args134.Req = req - var _result136 TCLIServiceCloseOperationResult - var _meta135 thrift.ResponseMeta - _meta135, _err = p.Client_().Call(ctx, "CloseOperation", &_args134, &_result136) - p.SetLastResponseMeta_(_meta135) - if _err != nil { - return - } - if _ret137 := _result136.GetSuccess(); _ret137 != nil { - return _ret137, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CloseOperation failed: unknown result") + var _args134 TCLIServiceCloseOperationArgs + _args134.Req = req + var _result136 TCLIServiceCloseOperationResult + var _meta135 thrift.ResponseMeta + _meta135, _err = p.Client_().Call(ctx, "CloseOperation", &_args134, &_result136) + p.SetLastResponseMeta_(_meta135) + if _err != nil { + return + } + if _ret137 := _result136.GetSuccess(); _ret137 != nil { + return _ret137, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CloseOperation failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetResultSetMetadata(ctx context.Context, req *TGetResultSetMetadataReq) (_r *TGetResultSetMetadataResp, _err error) { - var _args138 TCLIServiceGetResultSetMetadataArgs - _args138.Req = req - var _result140 TCLIServiceGetResultSetMetadataResult - var _meta139 thrift.ResponseMeta - _meta139, _err = p.Client_().Call(ctx, "GetResultSetMetadata", &_args138, &_result140) - p.SetLastResponseMeta_(_meta139) - if _err != nil { - return - } - if _ret141 := _result140.GetSuccess(); _ret141 != nil { - return _ret141, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetResultSetMetadata failed: unknown result") + var _args138 TCLIServiceGetResultSetMetadataArgs + _args138.Req = req + var _result140 TCLIServiceGetResultSetMetadataResult + var _meta139 thrift.ResponseMeta + _meta139, _err = p.Client_().Call(ctx, "GetResultSetMetadata", &_args138, &_result140) + p.SetLastResponseMeta_(_meta139) + if _err != nil { + return + } + if _ret141 := _result140.GetSuccess(); _ret141 != nil { + return _ret141, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetResultSetMetadata failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) FetchResults(ctx context.Context, req *TFetchResultsReq) (_r *TFetchResultsResp, _err error) { - var _args142 TCLIServiceFetchResultsArgs - _args142.Req = req - var _result144 TCLIServiceFetchResultsResult - var _meta143 thrift.ResponseMeta - _meta143, _err = p.Client_().Call(ctx, "FetchResults", &_args142, &_result144) - p.SetLastResponseMeta_(_meta143) - if _err != nil { - return - } - if _ret145 := _result144.GetSuccess(); _ret145 != nil { - return _ret145, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "FetchResults failed: unknown result") + var _args142 TCLIServiceFetchResultsArgs + _args142.Req = req + var _result144 TCLIServiceFetchResultsResult + var _meta143 thrift.ResponseMeta + _meta143, _err = p.Client_().Call(ctx, "FetchResults", &_args142, &_result144) + p.SetLastResponseMeta_(_meta143) + if _err != nil { + return + } + if _ret145 := _result144.GetSuccess(); _ret145 != nil { + return _ret145, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "FetchResults failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) GetDelegationToken(ctx context.Context, req *TGetDelegationTokenReq) (_r *TGetDelegationTokenResp, _err error) { - var _args146 TCLIServiceGetDelegationTokenArgs - _args146.Req = req - var _result148 TCLIServiceGetDelegationTokenResult - var _meta147 thrift.ResponseMeta - _meta147, _err = p.Client_().Call(ctx, "GetDelegationToken", &_args146, &_result148) - p.SetLastResponseMeta_(_meta147) - if _err != nil { - return - } - if _ret149 := _result148.GetSuccess(); _ret149 != nil { - return _ret149, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetDelegationToken failed: unknown result") + var _args146 TCLIServiceGetDelegationTokenArgs + _args146.Req = req + var _result148 TCLIServiceGetDelegationTokenResult + var _meta147 thrift.ResponseMeta + _meta147, _err = p.Client_().Call(ctx, "GetDelegationToken", &_args146, &_result148) + p.SetLastResponseMeta_(_meta147) + if _err != nil { + return + } + if _ret149 := _result148.GetSuccess(); _ret149 != nil { + return _ret149, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "GetDelegationToken failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) CancelDelegationToken(ctx context.Context, req *TCancelDelegationTokenReq) (_r *TCancelDelegationTokenResp, _err error) { - var _args150 TCLIServiceCancelDelegationTokenArgs - _args150.Req = req - var _result152 TCLIServiceCancelDelegationTokenResult - var _meta151 thrift.ResponseMeta - _meta151, _err = p.Client_().Call(ctx, "CancelDelegationToken", &_args150, &_result152) - p.SetLastResponseMeta_(_meta151) - if _err != nil { - return - } - if _ret153 := _result152.GetSuccess(); _ret153 != nil { - return _ret153, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CancelDelegationToken failed: unknown result") + var _args150 TCLIServiceCancelDelegationTokenArgs + _args150.Req = req + var _result152 TCLIServiceCancelDelegationTokenResult + var _meta151 thrift.ResponseMeta + _meta151, _err = p.Client_().Call(ctx, "CancelDelegationToken", &_args150, &_result152) + p.SetLastResponseMeta_(_meta151) + if _err != nil { + return + } + if _ret153 := _result152.GetSuccess(); _ret153 != nil { + return _ret153, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "CancelDelegationToken failed: unknown result") } // Parameters: -// - Req +// - Req func (p *TCLIServiceClient) RenewDelegationToken(ctx context.Context, req *TRenewDelegationTokenReq) (_r *TRenewDelegationTokenResp, _err error) { - var _args154 TCLIServiceRenewDelegationTokenArgs - _args154.Req = req - var _result156 TCLIServiceRenewDelegationTokenResult - var _meta155 thrift.ResponseMeta - _meta155, _err = p.Client_().Call(ctx, "RenewDelegationToken", &_args154, &_result156) - p.SetLastResponseMeta_(_meta155) - if _err != nil { - return - } - if _ret157 := _result156.GetSuccess(); _ret157 != nil { - return _ret157, nil - } - return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "RenewDelegationToken failed: unknown result") + var _args154 TCLIServiceRenewDelegationTokenArgs + _args154.Req = req + var _result156 TCLIServiceRenewDelegationTokenResult + var _meta155 thrift.ResponseMeta + _meta155, _err = p.Client_().Call(ctx, "RenewDelegationToken", &_args154, &_result156) + p.SetLastResponseMeta_(_meta155) + if _err != nil { + return + } + if _ret157 := _result156.GetSuccess(); _ret157 != nil { + return _ret157, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "RenewDelegationToken failed: unknown result") } type TCLIServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler TCLIService + processorMap map[string]thrift.TProcessorFunction + handler TCLIService } func (p *TCLIServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor + p.processorMap[key] = processor } func (p *TCLIServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok + processor, ok = p.processorMap[key] + return processor, ok } func (p *TCLIServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap + return p.processorMap } func NewTCLIServiceProcessor(handler TCLIService) *TCLIServiceProcessor { - self158 := &TCLIServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self158.processorMap["OpenSession"] = &tCLIServiceProcessorOpenSession{handler: handler} - self158.processorMap["CloseSession"] = &tCLIServiceProcessorCloseSession{handler: handler} - self158.processorMap["GetInfo"] = &tCLIServiceProcessorGetInfo{handler: handler} - self158.processorMap["ExecuteStatement"] = &tCLIServiceProcessorExecuteStatement{handler: handler} - self158.processorMap["GetTypeInfo"] = &tCLIServiceProcessorGetTypeInfo{handler: handler} - self158.processorMap["GetCatalogs"] = &tCLIServiceProcessorGetCatalogs{handler: handler} - self158.processorMap["GetSchemas"] = &tCLIServiceProcessorGetSchemas{handler: handler} - self158.processorMap["GetTables"] = &tCLIServiceProcessorGetTables{handler: handler} - self158.processorMap["GetTableTypes"] = &tCLIServiceProcessorGetTableTypes{handler: handler} - self158.processorMap["GetColumns"] = &tCLIServiceProcessorGetColumns{handler: handler} - self158.processorMap["GetFunctions"] = &tCLIServiceProcessorGetFunctions{handler: handler} - self158.processorMap["GetPrimaryKeys"] = &tCLIServiceProcessorGetPrimaryKeys{handler: handler} - self158.processorMap["GetCrossReference"] = &tCLIServiceProcessorGetCrossReference{handler: handler} - self158.processorMap["GetOperationStatus"] = &tCLIServiceProcessorGetOperationStatus{handler: handler} - self158.processorMap["CancelOperation"] = &tCLIServiceProcessorCancelOperation{handler: handler} - self158.processorMap["CloseOperation"] = &tCLIServiceProcessorCloseOperation{handler: handler} - self158.processorMap["GetResultSetMetadata"] = &tCLIServiceProcessorGetResultSetMetadata{handler: handler} - self158.processorMap["FetchResults"] = &tCLIServiceProcessorFetchResults{handler: handler} - self158.processorMap["GetDelegationToken"] = &tCLIServiceProcessorGetDelegationToken{handler: handler} - self158.processorMap["CancelDelegationToken"] = &tCLIServiceProcessorCancelDelegationToken{handler: handler} - self158.processorMap["RenewDelegationToken"] = &tCLIServiceProcessorRenewDelegationToken{handler: handler} - return self158 + self158 := &TCLIServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self158.processorMap["OpenSession"] = &tCLIServiceProcessorOpenSession{handler:handler} + self158.processorMap["CloseSession"] = &tCLIServiceProcessorCloseSession{handler:handler} + self158.processorMap["GetInfo"] = &tCLIServiceProcessorGetInfo{handler:handler} + self158.processorMap["ExecuteStatement"] = &tCLIServiceProcessorExecuteStatement{handler:handler} + self158.processorMap["GetTypeInfo"] = &tCLIServiceProcessorGetTypeInfo{handler:handler} + self158.processorMap["GetCatalogs"] = &tCLIServiceProcessorGetCatalogs{handler:handler} + self158.processorMap["GetSchemas"] = &tCLIServiceProcessorGetSchemas{handler:handler} + self158.processorMap["GetTables"] = &tCLIServiceProcessorGetTables{handler:handler} + self158.processorMap["GetTableTypes"] = &tCLIServiceProcessorGetTableTypes{handler:handler} + self158.processorMap["GetColumns"] = &tCLIServiceProcessorGetColumns{handler:handler} + self158.processorMap["GetFunctions"] = &tCLIServiceProcessorGetFunctions{handler:handler} + self158.processorMap["GetPrimaryKeys"] = &tCLIServiceProcessorGetPrimaryKeys{handler:handler} + self158.processorMap["GetCrossReference"] = &tCLIServiceProcessorGetCrossReference{handler:handler} + self158.processorMap["GetOperationStatus"] = &tCLIServiceProcessorGetOperationStatus{handler:handler} + self158.processorMap["CancelOperation"] = &tCLIServiceProcessorCancelOperation{handler:handler} + self158.processorMap["CloseOperation"] = &tCLIServiceProcessorCloseOperation{handler:handler} + self158.processorMap["GetResultSetMetadata"] = &tCLIServiceProcessorGetResultSetMetadata{handler:handler} + self158.processorMap["FetchResults"] = &tCLIServiceProcessorFetchResults{handler:handler} + self158.processorMap["GetDelegationToken"] = &tCLIServiceProcessorGetDelegationToken{handler:handler} + self158.processorMap["CancelDelegationToken"] = &tCLIServiceProcessorCancelDelegationToken{handler:handler} + self158.processorMap["RenewDelegationToken"] = &tCLIServiceProcessorRenewDelegationToken{handler:handler} +return self158 } func (p *TCLIServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) - if err2 != nil { - return false, thrift.WrapTException(err2) - } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) - } - iprot.Skip(ctx, thrift.STRUCT) - iprot.ReadMessageEnd(ctx) - x159 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) - oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) - x159.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, x159 + name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) + if err2 != nil { return false, thrift.WrapTException(err2) } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(ctx, thrift.STRUCT) + iprot.ReadMessageEnd(ctx) + x159 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x159.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, x159 } type tCLIServiceProcessorOpenSession struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorOpenSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err160 error - args := TCLIServiceOpenSessionArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "OpenSession", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceOpenSessionResult{} - if retval, err2 := p.handler.OpenSession(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc161 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing OpenSession: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "OpenSession", thrift.EXCEPTION, seqId); err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if err2 := _exc161.Write(ctx, oprot); _write_err160 == nil && err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err160 == nil && err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err160 == nil && err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if _write_err160 != nil { - return false, thrift.WrapTException(_write_err160) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "OpenSession", thrift.REPLY, seqId); err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err160 == nil && err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err160 == nil && err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err160 == nil && err2 != nil { - _write_err160 = thrift.WrapTException(err2) - } - if _write_err160 != nil { - return false, thrift.WrapTException(_write_err160) - } - return true, err + var _write_err160 error + args := TCLIServiceOpenSessionArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "OpenSession", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceOpenSessionResult{} + if retval, err2 := p.handler.OpenSession(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc161 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing OpenSession: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "OpenSession", thrift.EXCEPTION, seqId); err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if err2 := _exc161.Write(ctx, oprot); _write_err160 == nil && err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err160 == nil && err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err160 == nil && err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if _write_err160 != nil { + return false, thrift.WrapTException(_write_err160) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "OpenSession", thrift.REPLY, seqId); err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err160 == nil && err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err160 == nil && err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err160 == nil && err2 != nil { + _write_err160 = thrift.WrapTException(err2) + } + if _write_err160 != nil { + return false, thrift.WrapTException(_write_err160) + } + return true, err } type tCLIServiceProcessorCloseSession struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorCloseSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err162 error - args := TCLIServiceCloseSessionArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "CloseSession", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceCloseSessionResult{} - if retval, err2 := p.handler.CloseSession(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc163 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseSession: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "CloseSession", thrift.EXCEPTION, seqId); err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if err2 := _exc163.Write(ctx, oprot); _write_err162 == nil && err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err162 == nil && err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err162 == nil && err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if _write_err162 != nil { - return false, thrift.WrapTException(_write_err162) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "CloseSession", thrift.REPLY, seqId); err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err162 == nil && err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err162 == nil && err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err162 == nil && err2 != nil { - _write_err162 = thrift.WrapTException(err2) - } - if _write_err162 != nil { - return false, thrift.WrapTException(_write_err162) - } - return true, err + var _write_err162 error + args := TCLIServiceCloseSessionArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "CloseSession", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceCloseSessionResult{} + if retval, err2 := p.handler.CloseSession(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc163 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseSession: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "CloseSession", thrift.EXCEPTION, seqId); err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if err2 := _exc163.Write(ctx, oprot); _write_err162 == nil && err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err162 == nil && err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err162 == nil && err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if _write_err162 != nil { + return false, thrift.WrapTException(_write_err162) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "CloseSession", thrift.REPLY, seqId); err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err162 == nil && err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err162 == nil && err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err162 == nil && err2 != nil { + _write_err162 = thrift.WrapTException(err2) + } + if _write_err162 != nil { + return false, thrift.WrapTException(_write_err162) + } + return true, err } type tCLIServiceProcessorGetInfo struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err164 error - args := TCLIServiceGetInfoArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetInfo", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetInfoResult{} - if retval, err2 := p.handler.GetInfo(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc165 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetInfo: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetInfo", thrift.EXCEPTION, seqId); err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if err2 := _exc165.Write(ctx, oprot); _write_err164 == nil && err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err164 == nil && err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err164 == nil && err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if _write_err164 != nil { - return false, thrift.WrapTException(_write_err164) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetInfo", thrift.REPLY, seqId); err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err164 == nil && err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err164 == nil && err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err164 == nil && err2 != nil { - _write_err164 = thrift.WrapTException(err2) - } - if _write_err164 != nil { - return false, thrift.WrapTException(_write_err164) - } - return true, err + var _write_err164 error + args := TCLIServiceGetInfoArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetInfo", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetInfoResult{} + if retval, err2 := p.handler.GetInfo(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc165 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetInfo: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetInfo", thrift.EXCEPTION, seqId); err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if err2 := _exc165.Write(ctx, oprot); _write_err164 == nil && err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err164 == nil && err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err164 == nil && err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if _write_err164 != nil { + return false, thrift.WrapTException(_write_err164) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetInfo", thrift.REPLY, seqId); err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err164 == nil && err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err164 == nil && err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err164 == nil && err2 != nil { + _write_err164 = thrift.WrapTException(err2) + } + if _write_err164 != nil { + return false, thrift.WrapTException(_write_err164) + } + return true, err } type tCLIServiceProcessorExecuteStatement struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorExecuteStatement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err166 error - args := TCLIServiceExecuteStatementArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceExecuteStatementResult{} - if retval, err2 := p.handler.ExecuteStatement(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc167 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExecuteStatement: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.EXCEPTION, seqId); err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if err2 := _exc167.Write(ctx, oprot); _write_err166 == nil && err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err166 == nil && err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err166 == nil && err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if _write_err166 != nil { - return false, thrift.WrapTException(_write_err166) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.REPLY, seqId); err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err166 == nil && err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err166 == nil && err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err166 == nil && err2 != nil { - _write_err166 = thrift.WrapTException(err2) - } - if _write_err166 != nil { - return false, thrift.WrapTException(_write_err166) - } - return true, err + var _write_err166 error + args := TCLIServiceExecuteStatementArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceExecuteStatementResult{} + if retval, err2 := p.handler.ExecuteStatement(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc167 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExecuteStatement: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.EXCEPTION, seqId); err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if err2 := _exc167.Write(ctx, oprot); _write_err166 == nil && err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err166 == nil && err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err166 == nil && err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if _write_err166 != nil { + return false, thrift.WrapTException(_write_err166) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.REPLY, seqId); err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err166 == nil && err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err166 == nil && err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err166 == nil && err2 != nil { + _write_err166 = thrift.WrapTException(err2) + } + if _write_err166 != nil { + return false, thrift.WrapTException(_write_err166) + } + return true, err } type tCLIServiceProcessorGetTypeInfo struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetTypeInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err168 error - args := TCLIServiceGetTypeInfoArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetTypeInfoResult{} - if retval, err2 := p.handler.GetTypeInfo(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc169 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTypeInfo: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.EXCEPTION, seqId); err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if err2 := _exc169.Write(ctx, oprot); _write_err168 == nil && err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err168 == nil && err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err168 == nil && err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if _write_err168 != nil { - return false, thrift.WrapTException(_write_err168) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.REPLY, seqId); err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err168 == nil && err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err168 == nil && err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err168 == nil && err2 != nil { - _write_err168 = thrift.WrapTException(err2) - } - if _write_err168 != nil { - return false, thrift.WrapTException(_write_err168) - } - return true, err + var _write_err168 error + args := TCLIServiceGetTypeInfoArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetTypeInfoResult{} + if retval, err2 := p.handler.GetTypeInfo(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc169 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTypeInfo: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.EXCEPTION, seqId); err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if err2 := _exc169.Write(ctx, oprot); _write_err168 == nil && err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err168 == nil && err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err168 == nil && err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if _write_err168 != nil { + return false, thrift.WrapTException(_write_err168) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.REPLY, seqId); err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err168 == nil && err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err168 == nil && err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err168 == nil && err2 != nil { + _write_err168 = thrift.WrapTException(err2) + } + if _write_err168 != nil { + return false, thrift.WrapTException(_write_err168) + } + return true, err } type tCLIServiceProcessorGetCatalogs struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetCatalogs) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err170 error - args := TCLIServiceGetCatalogsArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetCatalogsResult{} - if retval, err2 := p.handler.GetCatalogs(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc171 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCatalogs: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.EXCEPTION, seqId); err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if err2 := _exc171.Write(ctx, oprot); _write_err170 == nil && err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err170 == nil && err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err170 == nil && err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if _write_err170 != nil { - return false, thrift.WrapTException(_write_err170) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.REPLY, seqId); err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err170 == nil && err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err170 == nil && err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err170 == nil && err2 != nil { - _write_err170 = thrift.WrapTException(err2) - } - if _write_err170 != nil { - return false, thrift.WrapTException(_write_err170) - } - return true, err + var _write_err170 error + args := TCLIServiceGetCatalogsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetCatalogsResult{} + if retval, err2 := p.handler.GetCatalogs(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc171 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCatalogs: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.EXCEPTION, seqId); err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if err2 := _exc171.Write(ctx, oprot); _write_err170 == nil && err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err170 == nil && err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err170 == nil && err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if _write_err170 != nil { + return false, thrift.WrapTException(_write_err170) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.REPLY, seqId); err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err170 == nil && err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err170 == nil && err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err170 == nil && err2 != nil { + _write_err170 = thrift.WrapTException(err2) + } + if _write_err170 != nil { + return false, thrift.WrapTException(_write_err170) + } + return true, err } type tCLIServiceProcessorGetSchemas struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetSchemas) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err172 error - args := TCLIServiceGetSchemasArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetSchemasResult{} - if retval, err2 := p.handler.GetSchemas(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc173 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetSchemas: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.EXCEPTION, seqId); err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if err2 := _exc173.Write(ctx, oprot); _write_err172 == nil && err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err172 == nil && err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err172 == nil && err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if _write_err172 != nil { - return false, thrift.WrapTException(_write_err172) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.REPLY, seqId); err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err172 == nil && err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err172 == nil && err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err172 == nil && err2 != nil { - _write_err172 = thrift.WrapTException(err2) - } - if _write_err172 != nil { - return false, thrift.WrapTException(_write_err172) - } - return true, err + var _write_err172 error + args := TCLIServiceGetSchemasArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetSchemasResult{} + if retval, err2 := p.handler.GetSchemas(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc173 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetSchemas: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.EXCEPTION, seqId); err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if err2 := _exc173.Write(ctx, oprot); _write_err172 == nil && err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err172 == nil && err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err172 == nil && err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if _write_err172 != nil { + return false, thrift.WrapTException(_write_err172) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.REPLY, seqId); err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err172 == nil && err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err172 == nil && err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err172 == nil && err2 != nil { + _write_err172 = thrift.WrapTException(err2) + } + if _write_err172 != nil { + return false, thrift.WrapTException(_write_err172) + } + return true, err } type tCLIServiceProcessorGetTables struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetTables) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err174 error - args := TCLIServiceGetTablesArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetTables", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetTablesResult{} - if retval, err2 := p.handler.GetTables(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc175 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTables: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetTables", thrift.EXCEPTION, seqId); err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if err2 := _exc175.Write(ctx, oprot); _write_err174 == nil && err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err174 == nil && err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err174 == nil && err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if _write_err174 != nil { - return false, thrift.WrapTException(_write_err174) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetTables", thrift.REPLY, seqId); err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err174 == nil && err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err174 == nil && err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err174 == nil && err2 != nil { - _write_err174 = thrift.WrapTException(err2) - } - if _write_err174 != nil { - return false, thrift.WrapTException(_write_err174) - } - return true, err + var _write_err174 error + args := TCLIServiceGetTablesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetTables", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetTablesResult{} + if retval, err2 := p.handler.GetTables(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc175 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTables: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetTables", thrift.EXCEPTION, seqId); err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if err2 := _exc175.Write(ctx, oprot); _write_err174 == nil && err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err174 == nil && err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err174 == nil && err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if _write_err174 != nil { + return false, thrift.WrapTException(_write_err174) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetTables", thrift.REPLY, seqId); err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err174 == nil && err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err174 == nil && err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err174 == nil && err2 != nil { + _write_err174 = thrift.WrapTException(err2) + } + if _write_err174 != nil { + return false, thrift.WrapTException(_write_err174) + } + return true, err } type tCLIServiceProcessorGetTableTypes struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetTableTypes) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err176 error - args := TCLIServiceGetTableTypesArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetTableTypesResult{} - if retval, err2 := p.handler.GetTableTypes(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc177 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTableTypes: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.EXCEPTION, seqId); err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if err2 := _exc177.Write(ctx, oprot); _write_err176 == nil && err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err176 == nil && err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err176 == nil && err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if _write_err176 != nil { - return false, thrift.WrapTException(_write_err176) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.REPLY, seqId); err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err176 == nil && err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err176 == nil && err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err176 == nil && err2 != nil { - _write_err176 = thrift.WrapTException(err2) - } - if _write_err176 != nil { - return false, thrift.WrapTException(_write_err176) - } - return true, err + var _write_err176 error + args := TCLIServiceGetTableTypesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetTableTypesResult{} + if retval, err2 := p.handler.GetTableTypes(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc177 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTableTypes: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.EXCEPTION, seqId); err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if err2 := _exc177.Write(ctx, oprot); _write_err176 == nil && err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err176 == nil && err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err176 == nil && err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if _write_err176 != nil { + return false, thrift.WrapTException(_write_err176) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.REPLY, seqId); err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err176 == nil && err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err176 == nil && err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err176 == nil && err2 != nil { + _write_err176 = thrift.WrapTException(err2) + } + if _write_err176 != nil { + return false, thrift.WrapTException(_write_err176) + } + return true, err } type tCLIServiceProcessorGetColumns struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetColumns) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err178 error - args := TCLIServiceGetColumnsArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetColumns", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetColumnsResult{} - if retval, err2 := p.handler.GetColumns(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc179 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetColumns: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetColumns", thrift.EXCEPTION, seqId); err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if err2 := _exc179.Write(ctx, oprot); _write_err178 == nil && err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err178 == nil && err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err178 == nil && err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if _write_err178 != nil { - return false, thrift.WrapTException(_write_err178) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetColumns", thrift.REPLY, seqId); err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err178 == nil && err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err178 == nil && err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err178 == nil && err2 != nil { - _write_err178 = thrift.WrapTException(err2) - } - if _write_err178 != nil { - return false, thrift.WrapTException(_write_err178) - } - return true, err + var _write_err178 error + args := TCLIServiceGetColumnsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetColumns", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetColumnsResult{} + if retval, err2 := p.handler.GetColumns(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc179 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetColumns: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetColumns", thrift.EXCEPTION, seqId); err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if err2 := _exc179.Write(ctx, oprot); _write_err178 == nil && err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err178 == nil && err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err178 == nil && err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if _write_err178 != nil { + return false, thrift.WrapTException(_write_err178) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetColumns", thrift.REPLY, seqId); err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err178 == nil && err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err178 == nil && err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err178 == nil && err2 != nil { + _write_err178 = thrift.WrapTException(err2) + } + if _write_err178 != nil { + return false, thrift.WrapTException(_write_err178) + } + return true, err } type tCLIServiceProcessorGetFunctions struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetFunctions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err180 error - args := TCLIServiceGetFunctionsArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetFunctionsResult{} - if retval, err2 := p.handler.GetFunctions(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc181 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetFunctions: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.EXCEPTION, seqId); err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if err2 := _exc181.Write(ctx, oprot); _write_err180 == nil && err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err180 == nil && err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err180 == nil && err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if _write_err180 != nil { - return false, thrift.WrapTException(_write_err180) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.REPLY, seqId); err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err180 == nil && err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err180 == nil && err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err180 == nil && err2 != nil { - _write_err180 = thrift.WrapTException(err2) - } - if _write_err180 != nil { - return false, thrift.WrapTException(_write_err180) - } - return true, err + var _write_err180 error + args := TCLIServiceGetFunctionsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetFunctionsResult{} + if retval, err2 := p.handler.GetFunctions(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc181 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetFunctions: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.EXCEPTION, seqId); err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if err2 := _exc181.Write(ctx, oprot); _write_err180 == nil && err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err180 == nil && err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err180 == nil && err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if _write_err180 != nil { + return false, thrift.WrapTException(_write_err180) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.REPLY, seqId); err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err180 == nil && err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err180 == nil && err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err180 == nil && err2 != nil { + _write_err180 = thrift.WrapTException(err2) + } + if _write_err180 != nil { + return false, thrift.WrapTException(_write_err180) + } + return true, err } type tCLIServiceProcessorGetPrimaryKeys struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetPrimaryKeys) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err182 error - args := TCLIServiceGetPrimaryKeysArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetPrimaryKeysResult{} - if retval, err2 := p.handler.GetPrimaryKeys(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc183 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetPrimaryKeys: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.EXCEPTION, seqId); err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if err2 := _exc183.Write(ctx, oprot); _write_err182 == nil && err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err182 == nil && err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err182 == nil && err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if _write_err182 != nil { - return false, thrift.WrapTException(_write_err182) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.REPLY, seqId); err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err182 == nil && err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err182 == nil && err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err182 == nil && err2 != nil { - _write_err182 = thrift.WrapTException(err2) - } - if _write_err182 != nil { - return false, thrift.WrapTException(_write_err182) - } - return true, err + var _write_err182 error + args := TCLIServiceGetPrimaryKeysArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetPrimaryKeysResult{} + if retval, err2 := p.handler.GetPrimaryKeys(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc183 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetPrimaryKeys: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.EXCEPTION, seqId); err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if err2 := _exc183.Write(ctx, oprot); _write_err182 == nil && err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err182 == nil && err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err182 == nil && err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if _write_err182 != nil { + return false, thrift.WrapTException(_write_err182) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.REPLY, seqId); err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err182 == nil && err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err182 == nil && err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err182 == nil && err2 != nil { + _write_err182 = thrift.WrapTException(err2) + } + if _write_err182 != nil { + return false, thrift.WrapTException(_write_err182) + } + return true, err } type tCLIServiceProcessorGetCrossReference struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetCrossReference) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err184 error - args := TCLIServiceGetCrossReferenceArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetCrossReferenceResult{} - if retval, err2 := p.handler.GetCrossReference(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc185 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCrossReference: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.EXCEPTION, seqId); err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if err2 := _exc185.Write(ctx, oprot); _write_err184 == nil && err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err184 == nil && err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err184 == nil && err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if _write_err184 != nil { - return false, thrift.WrapTException(_write_err184) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.REPLY, seqId); err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err184 == nil && err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err184 == nil && err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err184 == nil && err2 != nil { - _write_err184 = thrift.WrapTException(err2) - } - if _write_err184 != nil { - return false, thrift.WrapTException(_write_err184) - } - return true, err + var _write_err184 error + args := TCLIServiceGetCrossReferenceArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetCrossReferenceResult{} + if retval, err2 := p.handler.GetCrossReference(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc185 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCrossReference: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.EXCEPTION, seqId); err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if err2 := _exc185.Write(ctx, oprot); _write_err184 == nil && err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err184 == nil && err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err184 == nil && err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if _write_err184 != nil { + return false, thrift.WrapTException(_write_err184) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.REPLY, seqId); err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err184 == nil && err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err184 == nil && err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err184 == nil && err2 != nil { + _write_err184 = thrift.WrapTException(err2) + } + if _write_err184 != nil { + return false, thrift.WrapTException(_write_err184) + } + return true, err } type tCLIServiceProcessorGetOperationStatus struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetOperationStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err186 error - args := TCLIServiceGetOperationStatusArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetOperationStatusResult{} - if retval, err2 := p.handler.GetOperationStatus(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc187 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetOperationStatus: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.EXCEPTION, seqId); err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if err2 := _exc187.Write(ctx, oprot); _write_err186 == nil && err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err186 == nil && err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err186 == nil && err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if _write_err186 != nil { - return false, thrift.WrapTException(_write_err186) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.REPLY, seqId); err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err186 == nil && err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err186 == nil && err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err186 == nil && err2 != nil { - _write_err186 = thrift.WrapTException(err2) - } - if _write_err186 != nil { - return false, thrift.WrapTException(_write_err186) - } - return true, err + var _write_err186 error + args := TCLIServiceGetOperationStatusArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetOperationStatusResult{} + if retval, err2 := p.handler.GetOperationStatus(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc187 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetOperationStatus: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.EXCEPTION, seqId); err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if err2 := _exc187.Write(ctx, oprot); _write_err186 == nil && err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err186 == nil && err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err186 == nil && err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if _write_err186 != nil { + return false, thrift.WrapTException(_write_err186) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.REPLY, seqId); err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err186 == nil && err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err186 == nil && err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err186 == nil && err2 != nil { + _write_err186 = thrift.WrapTException(err2) + } + if _write_err186 != nil { + return false, thrift.WrapTException(_write_err186) + } + return true, err } type tCLIServiceProcessorCancelOperation struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorCancelOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err188 error - args := TCLIServiceCancelOperationArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceCancelOperationResult{} - if retval, err2 := p.handler.CancelOperation(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc189 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelOperation: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.EXCEPTION, seqId); err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if err2 := _exc189.Write(ctx, oprot); _write_err188 == nil && err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err188 == nil && err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err188 == nil && err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if _write_err188 != nil { - return false, thrift.WrapTException(_write_err188) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.REPLY, seqId); err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err188 == nil && err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err188 == nil && err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err188 == nil && err2 != nil { - _write_err188 = thrift.WrapTException(err2) - } - if _write_err188 != nil { - return false, thrift.WrapTException(_write_err188) - } - return true, err + var _write_err188 error + args := TCLIServiceCancelOperationArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceCancelOperationResult{} + if retval, err2 := p.handler.CancelOperation(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc189 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelOperation: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.EXCEPTION, seqId); err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if err2 := _exc189.Write(ctx, oprot); _write_err188 == nil && err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err188 == nil && err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err188 == nil && err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if _write_err188 != nil { + return false, thrift.WrapTException(_write_err188) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.REPLY, seqId); err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err188 == nil && err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err188 == nil && err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err188 == nil && err2 != nil { + _write_err188 = thrift.WrapTException(err2) + } + if _write_err188 != nil { + return false, thrift.WrapTException(_write_err188) + } + return true, err } type tCLIServiceProcessorCloseOperation struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorCloseOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err190 error - args := TCLIServiceCloseOperationArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceCloseOperationResult{} - if retval, err2 := p.handler.CloseOperation(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc191 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseOperation: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.EXCEPTION, seqId); err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if err2 := _exc191.Write(ctx, oprot); _write_err190 == nil && err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err190 == nil && err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err190 == nil && err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if _write_err190 != nil { - return false, thrift.WrapTException(_write_err190) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.REPLY, seqId); err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err190 == nil && err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err190 == nil && err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err190 == nil && err2 != nil { - _write_err190 = thrift.WrapTException(err2) - } - if _write_err190 != nil { - return false, thrift.WrapTException(_write_err190) - } - return true, err + var _write_err190 error + args := TCLIServiceCloseOperationArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceCloseOperationResult{} + if retval, err2 := p.handler.CloseOperation(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc191 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseOperation: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.EXCEPTION, seqId); err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if err2 := _exc191.Write(ctx, oprot); _write_err190 == nil && err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err190 == nil && err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err190 == nil && err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if _write_err190 != nil { + return false, thrift.WrapTException(_write_err190) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.REPLY, seqId); err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err190 == nil && err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err190 == nil && err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err190 == nil && err2 != nil { + _write_err190 = thrift.WrapTException(err2) + } + if _write_err190 != nil { + return false, thrift.WrapTException(_write_err190) + } + return true, err } type tCLIServiceProcessorGetResultSetMetadata struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetResultSetMetadata) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err192 error - args := TCLIServiceGetResultSetMetadataArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetResultSetMetadataResult{} - if retval, err2 := p.handler.GetResultSetMetadata(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc193 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetResultSetMetadata: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.EXCEPTION, seqId); err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if err2 := _exc193.Write(ctx, oprot); _write_err192 == nil && err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err192 == nil && err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err192 == nil && err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if _write_err192 != nil { - return false, thrift.WrapTException(_write_err192) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.REPLY, seqId); err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err192 == nil && err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err192 == nil && err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err192 == nil && err2 != nil { - _write_err192 = thrift.WrapTException(err2) - } - if _write_err192 != nil { - return false, thrift.WrapTException(_write_err192) - } - return true, err + var _write_err192 error + args := TCLIServiceGetResultSetMetadataArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetResultSetMetadataResult{} + if retval, err2 := p.handler.GetResultSetMetadata(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc193 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetResultSetMetadata: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.EXCEPTION, seqId); err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if err2 := _exc193.Write(ctx, oprot); _write_err192 == nil && err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err192 == nil && err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err192 == nil && err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if _write_err192 != nil { + return false, thrift.WrapTException(_write_err192) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.REPLY, seqId); err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err192 == nil && err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err192 == nil && err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err192 == nil && err2 != nil { + _write_err192 = thrift.WrapTException(err2) + } + if _write_err192 != nil { + return false, thrift.WrapTException(_write_err192) + } + return true, err } type tCLIServiceProcessorFetchResults struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorFetchResults) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err194 error - args := TCLIServiceFetchResultsArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "FetchResults", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceFetchResultsResult{} - if retval, err2 := p.handler.FetchResults(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc195 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing FetchResults: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "FetchResults", thrift.EXCEPTION, seqId); err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if err2 := _exc195.Write(ctx, oprot); _write_err194 == nil && err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err194 == nil && err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err194 == nil && err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if _write_err194 != nil { - return false, thrift.WrapTException(_write_err194) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "FetchResults", thrift.REPLY, seqId); err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err194 == nil && err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err194 == nil && err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err194 == nil && err2 != nil { - _write_err194 = thrift.WrapTException(err2) - } - if _write_err194 != nil { - return false, thrift.WrapTException(_write_err194) - } - return true, err + var _write_err194 error + args := TCLIServiceFetchResultsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "FetchResults", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceFetchResultsResult{} + if retval, err2 := p.handler.FetchResults(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc195 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing FetchResults: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "FetchResults", thrift.EXCEPTION, seqId); err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if err2 := _exc195.Write(ctx, oprot); _write_err194 == nil && err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err194 == nil && err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err194 == nil && err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if _write_err194 != nil { + return false, thrift.WrapTException(_write_err194) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "FetchResults", thrift.REPLY, seqId); err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err194 == nil && err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err194 == nil && err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err194 == nil && err2 != nil { + _write_err194 = thrift.WrapTException(err2) + } + if _write_err194 != nil { + return false, thrift.WrapTException(_write_err194) + } + return true, err } type tCLIServiceProcessorGetDelegationToken struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorGetDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err196 error - args := TCLIServiceGetDelegationTokenArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceGetDelegationTokenResult{} - if retval, err2 := p.handler.GetDelegationToken(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc197 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDelegationToken: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.EXCEPTION, seqId); err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if err2 := _exc197.Write(ctx, oprot); _write_err196 == nil && err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err196 == nil && err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err196 == nil && err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if _write_err196 != nil { - return false, thrift.WrapTException(_write_err196) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.REPLY, seqId); err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err196 == nil && err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err196 == nil && err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err196 == nil && err2 != nil { - _write_err196 = thrift.WrapTException(err2) - } - if _write_err196 != nil { - return false, thrift.WrapTException(_write_err196) - } - return true, err + var _write_err196 error + args := TCLIServiceGetDelegationTokenArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetDelegationTokenResult{} + if retval, err2 := p.handler.GetDelegationToken(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc197 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDelegationToken: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.EXCEPTION, seqId); err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if err2 := _exc197.Write(ctx, oprot); _write_err196 == nil && err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err196 == nil && err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err196 == nil && err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if _write_err196 != nil { + return false, thrift.WrapTException(_write_err196) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.REPLY, seqId); err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err196 == nil && err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err196 == nil && err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err196 == nil && err2 != nil { + _write_err196 = thrift.WrapTException(err2) + } + if _write_err196 != nil { + return false, thrift.WrapTException(_write_err196) + } + return true, err } type tCLIServiceProcessorCancelDelegationToken struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorCancelDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err198 error - args := TCLIServiceCancelDelegationTokenArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceCancelDelegationTokenResult{} - if retval, err2 := p.handler.CancelDelegationToken(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc199 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelDelegationToken: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.EXCEPTION, seqId); err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if err2 := _exc199.Write(ctx, oprot); _write_err198 == nil && err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err198 == nil && err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err198 == nil && err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if _write_err198 != nil { - return false, thrift.WrapTException(_write_err198) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.REPLY, seqId); err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err198 == nil && err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err198 == nil && err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err198 == nil && err2 != nil { - _write_err198 = thrift.WrapTException(err2) - } - if _write_err198 != nil { - return false, thrift.WrapTException(_write_err198) - } - return true, err + var _write_err198 error + args := TCLIServiceCancelDelegationTokenArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceCancelDelegationTokenResult{} + if retval, err2 := p.handler.CancelDelegationToken(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc199 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelDelegationToken: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.EXCEPTION, seqId); err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if err2 := _exc199.Write(ctx, oprot); _write_err198 == nil && err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err198 == nil && err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err198 == nil && err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if _write_err198 != nil { + return false, thrift.WrapTException(_write_err198) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.REPLY, seqId); err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err198 == nil && err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err198 == nil && err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err198 == nil && err2 != nil { + _write_err198 = thrift.WrapTException(err2) + } + if _write_err198 != nil { + return false, thrift.WrapTException(_write_err198) + } + return true, err } type tCLIServiceProcessorRenewDelegationToken struct { - handler TCLIService + handler TCLIService } func (p *tCLIServiceProcessorRenewDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - var _write_err200 error - args := TCLIServiceRenewDelegationTokenArgs{} - if err2 := args.Read(ctx, iprot); err2 != nil { - iprot.ReadMessageEnd(ctx) - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) - oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.EXCEPTION, seqId) - x.Write(ctx, oprot) - oprot.WriteMessageEnd(ctx) - oprot.Flush(ctx) - return false, thrift.WrapTException(err2) - } - iprot.ReadMessageEnd(ctx) - - tickerCancel := func() {} - // Start a goroutine to do server side connectivity check. - if thrift.ServerConnectivityCheckInterval > 0 { - var cancel context.CancelCauseFunc - ctx, cancel = context.WithCancelCause(ctx) - defer cancel(nil) - var tickerCtx context.Context - tickerCtx, tickerCancel = context.WithCancel(context.Background()) - defer tickerCancel() - go func(ctx context.Context, cancel context.CancelCauseFunc) { - ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) - defer ticker.Stop() - for { - select { - case <-ctx.Done(): - return - case <-ticker.C: - if !iprot.Transport().IsOpen() { - cancel(thrift.ErrAbandonRequest) - return - } - } - } - }(tickerCtx, cancel) - } - - result := TCLIServiceRenewDelegationTokenResult{} - if retval, err2 := p.handler.RenewDelegationToken(ctx, args.Req); err2 != nil { - tickerCancel() - err = thrift.WrapTException(err2) - if errors.Is(err2, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err2) - } - if errors.Is(err2, context.Canceled) { - if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { - return false, thrift.WrapTException(err) - } - } - _exc201 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RenewDelegationToken: "+err2.Error()) - if err2 := oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.EXCEPTION, seqId); err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if err2 := _exc201.Write(ctx, oprot); _write_err200 == nil && err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err200 == nil && err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err200 == nil && err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if _write_err200 != nil { - return false, thrift.WrapTException(_write_err200) - } - return true, err - } else { - result.Success = retval - } - tickerCancel() - if err2 := oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.REPLY, seqId); err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if err2 := result.Write(ctx, oprot); _write_err200 == nil && err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if err2 := oprot.WriteMessageEnd(ctx); _write_err200 == nil && err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if err2 := oprot.Flush(ctx); _write_err200 == nil && err2 != nil { - _write_err200 = thrift.WrapTException(err2) - } - if _write_err200 != nil { - return false, thrift.WrapTException(_write_err200) - } - return true, err + var _write_err200 error + args := TCLIServiceRenewDelegationTokenArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceRenewDelegationTokenResult{} + if retval, err2 := p.handler.RenewDelegationToken(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc201 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RenewDelegationToken: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.EXCEPTION, seqId); err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if err2 := _exc201.Write(ctx, oprot); _write_err200 == nil && err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err200 == nil && err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err200 == nil && err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if _write_err200 != nil { + return false, thrift.WrapTException(_write_err200) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.REPLY, seqId); err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err200 == nil && err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err200 == nil && err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err200 == nil && err2 != nil { + _write_err200 = thrift.WrapTException(err2) + } + if _write_err200 != nil { + return false, thrift.WrapTException(_write_err200) + } + return true, err } + // HELPER FUNCTIONS AND STRUCTURES // Attributes: -// - Req +// - Req type TCLIServiceOpenSessionArgs struct { - Req *TOpenSessionReq `thrift:"req,1" db:"req" json:"req"` + Req *TOpenSessionReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceOpenSessionArgs() *TCLIServiceOpenSessionArgs { - return &TCLIServiceOpenSessionArgs{} + return &TCLIServiceOpenSessionArgs{} } var TCLIServiceOpenSessionArgs_Req_DEFAULT *TOpenSessionReq - func (p *TCLIServiceOpenSessionArgs) GetReq() *TOpenSessionReq { - if !p.IsSetReq() { - return TCLIServiceOpenSessionArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceOpenSessionArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceOpenSessionArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceOpenSessionArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceOpenSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TOpenSessionReq{ - ClientProtocol: -7, - } - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceOpenSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TOpenSessionReq{ + ClientProtocol: -7, +} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceOpenSessionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "OpenSession_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "OpenSession_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceOpenSessionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceOpenSessionArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceOpenSessionArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceOpenSessionArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceOpenSessionResult struct { - Success *TOpenSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TOpenSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceOpenSessionResult() *TCLIServiceOpenSessionResult { - return &TCLIServiceOpenSessionResult{} + return &TCLIServiceOpenSessionResult{} } var TCLIServiceOpenSessionResult_Success_DEFAULT *TOpenSessionResp - func (p *TCLIServiceOpenSessionResult) GetSuccess() *TOpenSessionResp { - if !p.IsSetSuccess() { - return TCLIServiceOpenSessionResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceOpenSessionResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceOpenSessionResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceOpenSessionResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceOpenSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TOpenSessionResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceOpenSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TOpenSessionResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceOpenSessionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "OpenSession_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "OpenSession_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceOpenSessionResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceOpenSessionResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceOpenSessionResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceOpenSessionResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceCloseSessionArgs struct { - Req *TCloseSessionReq `thrift:"req,1" db:"req" json:"req"` + Req *TCloseSessionReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceCloseSessionArgs() *TCLIServiceCloseSessionArgs { - return &TCLIServiceCloseSessionArgs{} + return &TCLIServiceCloseSessionArgs{} } var TCLIServiceCloseSessionArgs_Req_DEFAULT *TCloseSessionReq - func (p *TCLIServiceCloseSessionArgs) GetReq() *TCloseSessionReq { - if !p.IsSetReq() { - return TCLIServiceCloseSessionArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceCloseSessionArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceCloseSessionArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceCloseSessionArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCloseSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TCloseSessionReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCloseSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TCloseSessionReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceCloseSessionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CloseSession_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "CloseSession_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceCloseSessionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceCloseSessionArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCloseSessionArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCloseSessionArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceCloseSessionResult struct { - Success *TCloseSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TCloseSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceCloseSessionResult() *TCLIServiceCloseSessionResult { - return &TCLIServiceCloseSessionResult{} + return &TCLIServiceCloseSessionResult{} } var TCLIServiceCloseSessionResult_Success_DEFAULT *TCloseSessionResp - func (p *TCLIServiceCloseSessionResult) GetSuccess() *TCloseSessionResp { - if !p.IsSetSuccess() { - return TCLIServiceCloseSessionResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceCloseSessionResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceCloseSessionResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceCloseSessionResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCloseSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TCloseSessionResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCloseSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TCloseSessionResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceCloseSessionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CloseSession_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "CloseSession_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceCloseSessionResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceCloseSessionResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCloseSessionResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCloseSessionResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetInfoArgs struct { - Req *TGetInfoReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetInfoReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetInfoArgs() *TCLIServiceGetInfoArgs { - return &TCLIServiceGetInfoArgs{} + return &TCLIServiceGetInfoArgs{} } var TCLIServiceGetInfoArgs_Req_DEFAULT *TGetInfoReq - func (p *TCLIServiceGetInfoArgs) GetReq() *TGetInfoReq { - if !p.IsSetReq() { - return TCLIServiceGetInfoArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceGetInfoArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceGetInfoArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetInfoArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetInfoReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetInfoReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetInfoArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetInfo_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetInfo_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetInfoArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceGetInfoArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetInfoArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetInfoArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetInfoResult struct { - Success *TGetInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetInfoResult() *TCLIServiceGetInfoResult { - return &TCLIServiceGetInfoResult{} + return &TCLIServiceGetInfoResult{} } var TCLIServiceGetInfoResult_Success_DEFAULT *TGetInfoResp - func (p *TCLIServiceGetInfoResult) GetSuccess() *TGetInfoResp { - if !p.IsSetSuccess() { - return TCLIServiceGetInfoResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetInfoResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceGetInfoResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetInfoResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetInfoResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetInfoResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetInfoResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetInfo_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetInfo_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetInfoResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceGetInfoResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetInfoResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetInfoResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceExecuteStatementArgs struct { - Req *TExecuteStatementReq `thrift:"req,1" db:"req" json:"req"` + Req *TExecuteStatementReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceExecuteStatementArgs() *TCLIServiceExecuteStatementArgs { - return &TCLIServiceExecuteStatementArgs{} + return &TCLIServiceExecuteStatementArgs{} } var TCLIServiceExecuteStatementArgs_Req_DEFAULT *TExecuteStatementReq - func (p *TCLIServiceExecuteStatementArgs) GetReq() *TExecuteStatementReq { - if !p.IsSetReq() { - return TCLIServiceExecuteStatementArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceExecuteStatementArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceExecuteStatementArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceExecuteStatementArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceExecuteStatementArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TExecuteStatementReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceExecuteStatementArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TExecuteStatementReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceExecuteStatementArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "ExecuteStatement_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "ExecuteStatement_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceExecuteStatementArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceExecuteStatementArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceExecuteStatementArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceExecuteStatementArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceExecuteStatementResult struct { - Success *TExecuteStatementResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TExecuteStatementResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceExecuteStatementResult() *TCLIServiceExecuteStatementResult { - return &TCLIServiceExecuteStatementResult{} + return &TCLIServiceExecuteStatementResult{} } var TCLIServiceExecuteStatementResult_Success_DEFAULT *TExecuteStatementResp - func (p *TCLIServiceExecuteStatementResult) GetSuccess() *TExecuteStatementResp { - if !p.IsSetSuccess() { - return TCLIServiceExecuteStatementResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceExecuteStatementResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceExecuteStatementResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceExecuteStatementResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceExecuteStatementResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TExecuteStatementResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceExecuteStatementResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TExecuteStatementResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceExecuteStatementResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "ExecuteStatement_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "ExecuteStatement_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceExecuteStatementResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceExecuteStatementResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceExecuteStatementResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceExecuteStatementResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetTypeInfoArgs struct { - Req *TGetTypeInfoReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetTypeInfoReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetTypeInfoArgs() *TCLIServiceGetTypeInfoArgs { - return &TCLIServiceGetTypeInfoArgs{} + return &TCLIServiceGetTypeInfoArgs{} } var TCLIServiceGetTypeInfoArgs_Req_DEFAULT *TGetTypeInfoReq - func (p *TCLIServiceGetTypeInfoArgs) GetReq() *TGetTypeInfoReq { - if !p.IsSetReq() { - return TCLIServiceGetTypeInfoArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceGetTypeInfoArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceGetTypeInfoArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetTypeInfoArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTypeInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetTypeInfoReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetTypeInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetTypeInfoReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetTypeInfoArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTypeInfo_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetTypeInfo_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetTypeInfoArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceGetTypeInfoArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetTypeInfoArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTypeInfoArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetTypeInfoResult struct { - Success *TGetTypeInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetTypeInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetTypeInfoResult() *TCLIServiceGetTypeInfoResult { - return &TCLIServiceGetTypeInfoResult{} + return &TCLIServiceGetTypeInfoResult{} } var TCLIServiceGetTypeInfoResult_Success_DEFAULT *TGetTypeInfoResp - func (p *TCLIServiceGetTypeInfoResult) GetSuccess() *TGetTypeInfoResp { - if !p.IsSetSuccess() { - return TCLIServiceGetTypeInfoResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetTypeInfoResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceGetTypeInfoResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetTypeInfoResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTypeInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetTypeInfoResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetTypeInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetTypeInfoResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetTypeInfoResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTypeInfo_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetTypeInfo_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetTypeInfoResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceGetTypeInfoResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetTypeInfoResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTypeInfoResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetCatalogsArgs struct { - Req *TGetCatalogsReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetCatalogsReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetCatalogsArgs() *TCLIServiceGetCatalogsArgs { - return &TCLIServiceGetCatalogsArgs{} + return &TCLIServiceGetCatalogsArgs{} } var TCLIServiceGetCatalogsArgs_Req_DEFAULT *TGetCatalogsReq - func (p *TCLIServiceGetCatalogsArgs) GetReq() *TGetCatalogsReq { - if !p.IsSetReq() { - return TCLIServiceGetCatalogsArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceGetCatalogsArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceGetCatalogsArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetCatalogsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetCatalogsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetCatalogsReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetCatalogsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetCatalogsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetCatalogsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetCatalogs_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetCatalogs_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetCatalogsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceGetCatalogsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetCatalogsArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetCatalogsArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetCatalogsResult struct { - Success *TGetCatalogsResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetCatalogsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetCatalogsResult() *TCLIServiceGetCatalogsResult { - return &TCLIServiceGetCatalogsResult{} + return &TCLIServiceGetCatalogsResult{} } var TCLIServiceGetCatalogsResult_Success_DEFAULT *TGetCatalogsResp - func (p *TCLIServiceGetCatalogsResult) GetSuccess() *TGetCatalogsResp { - if !p.IsSetSuccess() { - return TCLIServiceGetCatalogsResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetCatalogsResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceGetCatalogsResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetCatalogsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetCatalogsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetCatalogsResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetCatalogsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetCatalogsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetCatalogsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetCatalogs_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetCatalogs_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetCatalogsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceGetCatalogsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetCatalogsResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetCatalogsResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetSchemasArgs struct { - Req *TGetSchemasReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetSchemasReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetSchemasArgs() *TCLIServiceGetSchemasArgs { - return &TCLIServiceGetSchemasArgs{} + return &TCLIServiceGetSchemasArgs{} } var TCLIServiceGetSchemasArgs_Req_DEFAULT *TGetSchemasReq - func (p *TCLIServiceGetSchemasArgs) GetReq() *TGetSchemasReq { - if !p.IsSetReq() { - return TCLIServiceGetSchemasArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceGetSchemasArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceGetSchemasArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetSchemasArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetSchemasArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetSchemasReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetSchemasArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetSchemasReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetSchemasArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetSchemas_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetSchemas_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetSchemasArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceGetSchemasArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetSchemasArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetSchemasArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetSchemasResult struct { - Success *TGetSchemasResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetSchemasResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetSchemasResult() *TCLIServiceGetSchemasResult { - return &TCLIServiceGetSchemasResult{} + return &TCLIServiceGetSchemasResult{} } var TCLIServiceGetSchemasResult_Success_DEFAULT *TGetSchemasResp - func (p *TCLIServiceGetSchemasResult) GetSuccess() *TGetSchemasResp { - if !p.IsSetSuccess() { - return TCLIServiceGetSchemasResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetSchemasResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceGetSchemasResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetSchemasResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetSchemasResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetSchemasResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetSchemasResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetSchemasResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetSchemasResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetSchemas_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetSchemas_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetSchemasResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceGetSchemasResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetSchemasResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetSchemasResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetTablesArgs struct { - Req *TGetTablesReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetTablesReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetTablesArgs() *TCLIServiceGetTablesArgs { - return &TCLIServiceGetTablesArgs{} + return &TCLIServiceGetTablesArgs{} } var TCLIServiceGetTablesArgs_Req_DEFAULT *TGetTablesReq - func (p *TCLIServiceGetTablesArgs) GetReq() *TGetTablesReq { - if !p.IsSetReq() { - return TCLIServiceGetTablesArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceGetTablesArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceGetTablesArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetTablesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTablesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetTablesReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetTablesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetTablesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetTablesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTables_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetTables_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetTablesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceGetTablesArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetTablesArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTablesArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetTablesResult struct { - Success *TGetTablesResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetTablesResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetTablesResult() *TCLIServiceGetTablesResult { - return &TCLIServiceGetTablesResult{} + return &TCLIServiceGetTablesResult{} } var TCLIServiceGetTablesResult_Success_DEFAULT *TGetTablesResp - func (p *TCLIServiceGetTablesResult) GetSuccess() *TGetTablesResp { - if !p.IsSetSuccess() { - return TCLIServiceGetTablesResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetTablesResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceGetTablesResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetTablesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTablesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetTablesResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetTablesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetTablesResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetTablesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTables_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetTables_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetTablesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceGetTablesResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetTablesResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTablesResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetTableTypesArgs struct { - Req *TGetTableTypesReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetTableTypesReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetTableTypesArgs() *TCLIServiceGetTableTypesArgs { - return &TCLIServiceGetTableTypesArgs{} + return &TCLIServiceGetTableTypesArgs{} } var TCLIServiceGetTableTypesArgs_Req_DEFAULT *TGetTableTypesReq - func (p *TCLIServiceGetTableTypesArgs) GetReq() *TGetTableTypesReq { - if !p.IsSetReq() { - return TCLIServiceGetTableTypesArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceGetTableTypesArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceGetTableTypesArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetTableTypesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTableTypesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetTableTypesReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetTableTypesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetTableTypesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetTableTypesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTableTypes_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetTableTypes_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetTableTypesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceGetTableTypesArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetTableTypesArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTableTypesArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetTableTypesResult struct { - Success *TGetTableTypesResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetTableTypesResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetTableTypesResult() *TCLIServiceGetTableTypesResult { - return &TCLIServiceGetTableTypesResult{} + return &TCLIServiceGetTableTypesResult{} } var TCLIServiceGetTableTypesResult_Success_DEFAULT *TGetTableTypesResp - func (p *TCLIServiceGetTableTypesResult) GetSuccess() *TGetTableTypesResp { - if !p.IsSetSuccess() { - return TCLIServiceGetTableTypesResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetTableTypesResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceGetTableTypesResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetTableTypesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetTableTypesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetTableTypesResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetTableTypesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetTableTypesResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetTableTypesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetTableTypes_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetTableTypes_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetTableTypesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceGetTableTypesResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetTableTypesResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetTableTypesResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetColumnsArgs struct { - Req *TGetColumnsReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetColumnsReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetColumnsArgs() *TCLIServiceGetColumnsArgs { - return &TCLIServiceGetColumnsArgs{} + return &TCLIServiceGetColumnsArgs{} } var TCLIServiceGetColumnsArgs_Req_DEFAULT *TGetColumnsReq - func (p *TCLIServiceGetColumnsArgs) GetReq() *TGetColumnsReq { - if !p.IsSetReq() { - return TCLIServiceGetColumnsArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceGetColumnsArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceGetColumnsArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetColumnsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetColumnsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetColumnsReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetColumnsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetColumnsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetColumnsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetColumns_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetColumns_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetColumnsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceGetColumnsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetColumnsArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetColumnsArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetColumnsResult struct { - Success *TGetColumnsResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetColumnsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetColumnsResult() *TCLIServiceGetColumnsResult { - return &TCLIServiceGetColumnsResult{} + return &TCLIServiceGetColumnsResult{} } var TCLIServiceGetColumnsResult_Success_DEFAULT *TGetColumnsResp - func (p *TCLIServiceGetColumnsResult) GetSuccess() *TGetColumnsResp { - if !p.IsSetSuccess() { - return TCLIServiceGetColumnsResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetColumnsResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceGetColumnsResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetColumnsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetColumnsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetColumnsResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetColumnsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetColumnsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetColumnsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetColumns_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetColumns_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetColumnsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceGetColumnsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetColumnsResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetColumnsResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetFunctionsArgs struct { - Req *TGetFunctionsReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetFunctionsReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetFunctionsArgs() *TCLIServiceGetFunctionsArgs { - return &TCLIServiceGetFunctionsArgs{} + return &TCLIServiceGetFunctionsArgs{} } var TCLIServiceGetFunctionsArgs_Req_DEFAULT *TGetFunctionsReq - func (p *TCLIServiceGetFunctionsArgs) GetReq() *TGetFunctionsReq { - if !p.IsSetReq() { - return TCLIServiceGetFunctionsArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceGetFunctionsArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceGetFunctionsArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetFunctionsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetFunctionsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetFunctionsReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetFunctionsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetFunctionsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetFunctionsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetFunctions_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetFunctions_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetFunctionsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceGetFunctionsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetFunctionsArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetFunctionsArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetFunctionsResult struct { - Success *TGetFunctionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetFunctionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetFunctionsResult() *TCLIServiceGetFunctionsResult { - return &TCLIServiceGetFunctionsResult{} + return &TCLIServiceGetFunctionsResult{} } var TCLIServiceGetFunctionsResult_Success_DEFAULT *TGetFunctionsResp - func (p *TCLIServiceGetFunctionsResult) GetSuccess() *TGetFunctionsResp { - if !p.IsSetSuccess() { - return TCLIServiceGetFunctionsResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetFunctionsResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceGetFunctionsResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetFunctionsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetFunctionsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetFunctionsResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetFunctionsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetFunctionsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetFunctionsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetFunctions_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetFunctions_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetFunctionsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceGetFunctionsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetFunctionsResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetFunctionsResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetPrimaryKeysArgs struct { - Req *TGetPrimaryKeysReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetPrimaryKeysReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetPrimaryKeysArgs() *TCLIServiceGetPrimaryKeysArgs { - return &TCLIServiceGetPrimaryKeysArgs{} + return &TCLIServiceGetPrimaryKeysArgs{} } var TCLIServiceGetPrimaryKeysArgs_Req_DEFAULT *TGetPrimaryKeysReq - func (p *TCLIServiceGetPrimaryKeysArgs) GetReq() *TGetPrimaryKeysReq { - if !p.IsSetReq() { - return TCLIServiceGetPrimaryKeysArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceGetPrimaryKeysArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceGetPrimaryKeysArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetPrimaryKeysArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetPrimaryKeysArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetPrimaryKeysReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetPrimaryKeysArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetPrimaryKeysReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetPrimaryKeysArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetPrimaryKeys_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetPrimaryKeys_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetPrimaryKeysArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceGetPrimaryKeysArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetPrimaryKeysArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetPrimaryKeysArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetPrimaryKeysResult struct { - Success *TGetPrimaryKeysResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetPrimaryKeysResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetPrimaryKeysResult() *TCLIServiceGetPrimaryKeysResult { - return &TCLIServiceGetPrimaryKeysResult{} + return &TCLIServiceGetPrimaryKeysResult{} } var TCLIServiceGetPrimaryKeysResult_Success_DEFAULT *TGetPrimaryKeysResp - func (p *TCLIServiceGetPrimaryKeysResult) GetSuccess() *TGetPrimaryKeysResp { - if !p.IsSetSuccess() { - return TCLIServiceGetPrimaryKeysResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetPrimaryKeysResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceGetPrimaryKeysResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetPrimaryKeysResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetPrimaryKeysResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetPrimaryKeysResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetPrimaryKeysResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetPrimaryKeysResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetPrimaryKeysResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetPrimaryKeys_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetPrimaryKeys_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetPrimaryKeysResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceGetPrimaryKeysResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetPrimaryKeysResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetPrimaryKeysResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetCrossReferenceArgs struct { - Req *TGetCrossReferenceReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetCrossReferenceReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetCrossReferenceArgs() *TCLIServiceGetCrossReferenceArgs { - return &TCLIServiceGetCrossReferenceArgs{} + return &TCLIServiceGetCrossReferenceArgs{} } var TCLIServiceGetCrossReferenceArgs_Req_DEFAULT *TGetCrossReferenceReq - func (p *TCLIServiceGetCrossReferenceArgs) GetReq() *TGetCrossReferenceReq { - if !p.IsSetReq() { - return TCLIServiceGetCrossReferenceArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceGetCrossReferenceArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceGetCrossReferenceArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetCrossReferenceArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetCrossReferenceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetCrossReferenceReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetCrossReferenceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetCrossReferenceReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetCrossReferenceArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetCrossReference_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetCrossReference_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetCrossReferenceArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceGetCrossReferenceArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetCrossReferenceArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetCrossReferenceArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetCrossReferenceResult struct { - Success *TGetCrossReferenceResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetCrossReferenceResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetCrossReferenceResult() *TCLIServiceGetCrossReferenceResult { - return &TCLIServiceGetCrossReferenceResult{} + return &TCLIServiceGetCrossReferenceResult{} } var TCLIServiceGetCrossReferenceResult_Success_DEFAULT *TGetCrossReferenceResp - func (p *TCLIServiceGetCrossReferenceResult) GetSuccess() *TGetCrossReferenceResp { - if !p.IsSetSuccess() { - return TCLIServiceGetCrossReferenceResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetCrossReferenceResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceGetCrossReferenceResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetCrossReferenceResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetCrossReferenceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetCrossReferenceResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetCrossReferenceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetCrossReferenceResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetCrossReferenceResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetCrossReference_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetCrossReference_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetCrossReferenceResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceGetCrossReferenceResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetCrossReferenceResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetCrossReferenceResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetOperationStatusArgs struct { - Req *TGetOperationStatusReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetOperationStatusReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetOperationStatusArgs() *TCLIServiceGetOperationStatusArgs { - return &TCLIServiceGetOperationStatusArgs{} + return &TCLIServiceGetOperationStatusArgs{} } var TCLIServiceGetOperationStatusArgs_Req_DEFAULT *TGetOperationStatusReq - func (p *TCLIServiceGetOperationStatusArgs) GetReq() *TGetOperationStatusReq { - if !p.IsSetReq() { - return TCLIServiceGetOperationStatusArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceGetOperationStatusArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceGetOperationStatusArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetOperationStatusArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetOperationStatusArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetOperationStatusReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetOperationStatusArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetOperationStatusReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetOperationStatusArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetOperationStatus_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetOperationStatus_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetOperationStatusArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceGetOperationStatusArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetOperationStatusArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetOperationStatusArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetOperationStatusResult struct { - Success *TGetOperationStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetOperationStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetOperationStatusResult() *TCLIServiceGetOperationStatusResult { - return &TCLIServiceGetOperationStatusResult{} + return &TCLIServiceGetOperationStatusResult{} } var TCLIServiceGetOperationStatusResult_Success_DEFAULT *TGetOperationStatusResp - func (p *TCLIServiceGetOperationStatusResult) GetSuccess() *TGetOperationStatusResp { - if !p.IsSetSuccess() { - return TCLIServiceGetOperationStatusResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetOperationStatusResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceGetOperationStatusResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetOperationStatusResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetOperationStatusResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetOperationStatusResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetOperationStatusResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetOperationStatusResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetOperationStatusResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetOperationStatus_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetOperationStatus_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetOperationStatusResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceGetOperationStatusResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetOperationStatusResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetOperationStatusResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceCancelOperationArgs struct { - Req *TCancelOperationReq `thrift:"req,1" db:"req" json:"req"` + Req *TCancelOperationReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceCancelOperationArgs() *TCLIServiceCancelOperationArgs { - return &TCLIServiceCancelOperationArgs{} + return &TCLIServiceCancelOperationArgs{} } var TCLIServiceCancelOperationArgs_Req_DEFAULT *TCancelOperationReq - func (p *TCLIServiceCancelOperationArgs) GetReq() *TCancelOperationReq { - if !p.IsSetReq() { - return TCLIServiceCancelOperationArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceCancelOperationArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceCancelOperationArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceCancelOperationArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCancelOperationArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TCancelOperationReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCancelOperationArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TCancelOperationReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceCancelOperationArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CancelOperation_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "CancelOperation_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceCancelOperationArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceCancelOperationArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCancelOperationArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCancelOperationArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceCancelOperationResult struct { - Success *TCancelOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TCancelOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceCancelOperationResult() *TCLIServiceCancelOperationResult { - return &TCLIServiceCancelOperationResult{} + return &TCLIServiceCancelOperationResult{} } var TCLIServiceCancelOperationResult_Success_DEFAULT *TCancelOperationResp - func (p *TCLIServiceCancelOperationResult) GetSuccess() *TCancelOperationResp { - if !p.IsSetSuccess() { - return TCLIServiceCancelOperationResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceCancelOperationResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceCancelOperationResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceCancelOperationResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCancelOperationResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TCancelOperationResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCancelOperationResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TCancelOperationResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceCancelOperationResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CancelOperation_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "CancelOperation_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceCancelOperationResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceCancelOperationResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCancelOperationResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCancelOperationResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceCloseOperationArgs struct { - Req *TCloseOperationReq `thrift:"req,1" db:"req" json:"req"` + Req *TCloseOperationReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceCloseOperationArgs() *TCLIServiceCloseOperationArgs { - return &TCLIServiceCloseOperationArgs{} + return &TCLIServiceCloseOperationArgs{} } var TCLIServiceCloseOperationArgs_Req_DEFAULT *TCloseOperationReq - func (p *TCLIServiceCloseOperationArgs) GetReq() *TCloseOperationReq { - if !p.IsSetReq() { - return TCLIServiceCloseOperationArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceCloseOperationArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceCloseOperationArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceCloseOperationArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCloseOperationArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TCloseOperationReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCloseOperationArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TCloseOperationReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceCloseOperationArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CloseOperation_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "CloseOperation_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceCloseOperationArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceCloseOperationArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCloseOperationArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCloseOperationArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceCloseOperationResult struct { - Success *TCloseOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TCloseOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceCloseOperationResult() *TCLIServiceCloseOperationResult { - return &TCLIServiceCloseOperationResult{} + return &TCLIServiceCloseOperationResult{} } var TCLIServiceCloseOperationResult_Success_DEFAULT *TCloseOperationResp - func (p *TCLIServiceCloseOperationResult) GetSuccess() *TCloseOperationResp { - if !p.IsSetSuccess() { - return TCLIServiceCloseOperationResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceCloseOperationResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceCloseOperationResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceCloseOperationResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCloseOperationResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TCloseOperationResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCloseOperationResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TCloseOperationResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceCloseOperationResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CloseOperation_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "CloseOperation_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceCloseOperationResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceCloseOperationResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCloseOperationResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCloseOperationResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetResultSetMetadataArgs struct { - Req *TGetResultSetMetadataReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetResultSetMetadataReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetResultSetMetadataArgs() *TCLIServiceGetResultSetMetadataArgs { - return &TCLIServiceGetResultSetMetadataArgs{} + return &TCLIServiceGetResultSetMetadataArgs{} } var TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT *TGetResultSetMetadataReq - func (p *TCLIServiceGetResultSetMetadataArgs) GetReq() *TGetResultSetMetadataReq { - if !p.IsSetReq() { - return TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceGetResultSetMetadataArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetResultSetMetadataArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetResultSetMetadataArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetResultSetMetadataReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetResultSetMetadataArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetResultSetMetadataReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetResultSetMetadataArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetResultSetMetadata_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetResultSetMetadata_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetResultSetMetadataArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceGetResultSetMetadataArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetResultSetMetadataArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetResultSetMetadataArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetResultSetMetadataResult struct { - Success *TGetResultSetMetadataResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetResultSetMetadataResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetResultSetMetadataResult() *TCLIServiceGetResultSetMetadataResult { - return &TCLIServiceGetResultSetMetadataResult{} + return &TCLIServiceGetResultSetMetadataResult{} } var TCLIServiceGetResultSetMetadataResult_Success_DEFAULT *TGetResultSetMetadataResp - func (p *TCLIServiceGetResultSetMetadataResult) GetSuccess() *TGetResultSetMetadataResp { - if !p.IsSetSuccess() { - return TCLIServiceGetResultSetMetadataResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetResultSetMetadataResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceGetResultSetMetadataResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetResultSetMetadataResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetResultSetMetadataResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetResultSetMetadataResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetResultSetMetadataResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetResultSetMetadataResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetResultSetMetadataResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetResultSetMetadata_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetResultSetMetadata_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetResultSetMetadataResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceGetResultSetMetadataResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetResultSetMetadataResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetResultSetMetadataResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceFetchResultsArgs struct { - Req *TFetchResultsReq `thrift:"req,1" db:"req" json:"req"` + Req *TFetchResultsReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceFetchResultsArgs() *TCLIServiceFetchResultsArgs { - return &TCLIServiceFetchResultsArgs{} + return &TCLIServiceFetchResultsArgs{} } var TCLIServiceFetchResultsArgs_Req_DEFAULT *TFetchResultsReq - func (p *TCLIServiceFetchResultsArgs) GetReq() *TFetchResultsReq { - if !p.IsSetReq() { - return TCLIServiceFetchResultsArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceFetchResultsArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceFetchResultsArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceFetchResultsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceFetchResultsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TFetchResultsReq{ - Orientation: 0, - } - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceFetchResultsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TFetchResultsReq{ + Orientation: 0, +} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceFetchResultsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "FetchResults_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "FetchResults_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceFetchResultsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceFetchResultsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceFetchResultsArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceFetchResultsArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceFetchResultsResult struct { - Success *TFetchResultsResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TFetchResultsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceFetchResultsResult() *TCLIServiceFetchResultsResult { - return &TCLIServiceFetchResultsResult{} + return &TCLIServiceFetchResultsResult{} } var TCLIServiceFetchResultsResult_Success_DEFAULT *TFetchResultsResp - func (p *TCLIServiceFetchResultsResult) GetSuccess() *TFetchResultsResp { - if !p.IsSetSuccess() { - return TCLIServiceFetchResultsResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceFetchResultsResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceFetchResultsResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceFetchResultsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceFetchResultsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TFetchResultsResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceFetchResultsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TFetchResultsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceFetchResultsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "FetchResults_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "FetchResults_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceFetchResultsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceFetchResultsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceFetchResultsResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceFetchResultsResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceGetDelegationTokenArgs struct { - Req *TGetDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` + Req *TGetDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceGetDelegationTokenArgs() *TCLIServiceGetDelegationTokenArgs { - return &TCLIServiceGetDelegationTokenArgs{} + return &TCLIServiceGetDelegationTokenArgs{} } var TCLIServiceGetDelegationTokenArgs_Req_DEFAULT *TGetDelegationTokenReq - func (p *TCLIServiceGetDelegationTokenArgs) GetReq() *TGetDelegationTokenReq { - if !p.IsSetReq() { - return TCLIServiceGetDelegationTokenArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceGetDelegationTokenArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceGetDelegationTokenArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceGetDelegationTokenArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TGetDelegationTokenReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetDelegationTokenReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceGetDelegationTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetDelegationToken_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetDelegationToken_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetDelegationTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceGetDelegationTokenArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetDelegationTokenArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetDelegationTokenArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceGetDelegationTokenResult struct { - Success *TGetDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TGetDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceGetDelegationTokenResult() *TCLIServiceGetDelegationTokenResult { - return &TCLIServiceGetDelegationTokenResult{} + return &TCLIServiceGetDelegationTokenResult{} } var TCLIServiceGetDelegationTokenResult_Success_DEFAULT *TGetDelegationTokenResp - func (p *TCLIServiceGetDelegationTokenResult) GetSuccess() *TGetDelegationTokenResp { - if !p.IsSetSuccess() { - return TCLIServiceGetDelegationTokenResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceGetDelegationTokenResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceGetDelegationTokenResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceGetDelegationTokenResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceGetDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TGetDelegationTokenResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceGetDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetDelegationTokenResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceGetDelegationTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "GetDelegationToken_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "GetDelegationToken_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceGetDelegationTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceGetDelegationTokenResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceGetDelegationTokenResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetDelegationTokenResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceCancelDelegationTokenArgs struct { - Req *TCancelDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` + Req *TCancelDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceCancelDelegationTokenArgs() *TCLIServiceCancelDelegationTokenArgs { - return &TCLIServiceCancelDelegationTokenArgs{} + return &TCLIServiceCancelDelegationTokenArgs{} } var TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT *TCancelDelegationTokenReq - func (p *TCLIServiceCancelDelegationTokenArgs) GetReq() *TCancelDelegationTokenReq { - if !p.IsSetReq() { - return TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceCancelDelegationTokenArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceCancelDelegationTokenArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCancelDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TCancelDelegationTokenReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCancelDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TCancelDelegationTokenReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceCancelDelegationTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CancelDelegationToken_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "CancelDelegationToken_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceCancelDelegationTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceCancelDelegationTokenArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCancelDelegationTokenArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCancelDelegationTokenArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceCancelDelegationTokenResult struct { - Success *TCancelDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TCancelDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceCancelDelegationTokenResult() *TCLIServiceCancelDelegationTokenResult { - return &TCLIServiceCancelDelegationTokenResult{} + return &TCLIServiceCancelDelegationTokenResult{} } var TCLIServiceCancelDelegationTokenResult_Success_DEFAULT *TCancelDelegationTokenResp - func (p *TCLIServiceCancelDelegationTokenResult) GetSuccess() *TCancelDelegationTokenResp { - if !p.IsSetSuccess() { - return TCLIServiceCancelDelegationTokenResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceCancelDelegationTokenResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceCancelDelegationTokenResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceCancelDelegationTokenResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceCancelDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TCancelDelegationTokenResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceCancelDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TCancelDelegationTokenResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceCancelDelegationTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "CancelDelegationToken_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "CancelDelegationToken_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceCancelDelegationTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceCancelDelegationTokenResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceCancelDelegationTokenResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCancelDelegationTokenResult(%+v)", *p) } // Attributes: -// - Req +// - Req type TCLIServiceRenewDelegationTokenArgs struct { - Req *TRenewDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` + Req *TRenewDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` } func NewTCLIServiceRenewDelegationTokenArgs() *TCLIServiceRenewDelegationTokenArgs { - return &TCLIServiceRenewDelegationTokenArgs{} + return &TCLIServiceRenewDelegationTokenArgs{} } var TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT *TRenewDelegationTokenReq - func (p *TCLIServiceRenewDelegationTokenArgs) GetReq() *TRenewDelegationTokenReq { - if !p.IsSetReq() { - return TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT - } - return p.Req + if !p.IsSetReq() { + return TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT + } +return p.Req } func (p *TCLIServiceRenewDelegationTokenArgs) IsSetReq() bool { - return p.Req != nil + return p.Req != nil } func (p *TCLIServiceRenewDelegationTokenArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceRenewDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { - p.Req = &TRenewDelegationTokenReq{} - if err := p.Req.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceRenewDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TRenewDelegationTokenReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } func (p *TCLIServiceRenewDelegationTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "RenewDelegationToken_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField1(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "RenewDelegationToken_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceRenewDelegationTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) - } - if err := p.Req.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) - } - return err + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } func (p *TCLIServiceRenewDelegationTokenArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceRenewDelegationTokenArgs(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceRenewDelegationTokenArgs(%+v)", *p) } // Attributes: -// - Success +// - Success type TCLIServiceRenewDelegationTokenResult struct { - Success *TRenewDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` + Success *TRenewDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` } func NewTCLIServiceRenewDelegationTokenResult() *TCLIServiceRenewDelegationTokenResult { - return &TCLIServiceRenewDelegationTokenResult{} + return &TCLIServiceRenewDelegationTokenResult{} } var TCLIServiceRenewDelegationTokenResult_Success_DEFAULT *TRenewDelegationTokenResp - func (p *TCLIServiceRenewDelegationTokenResult) GetSuccess() *TRenewDelegationTokenResp { - if !p.IsSetSuccess() { - return TCLIServiceRenewDelegationTokenResult_Success_DEFAULT - } - return p.Success + if !p.IsSetSuccess() { + return TCLIServiceRenewDelegationTokenResult_Success_DEFAULT + } +return p.Success } func (p *TCLIServiceRenewDelegationTokenResult) IsSetSuccess() bool { - return p.Success != nil + return p.Success != nil } func (p *TCLIServiceRenewDelegationTokenResult) Read(ctx context.Context, iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(ctx, iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(ctx, fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(ctx); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *TCLIServiceRenewDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { - p.Success = &TRenewDelegationTokenResp{} - if err := p.Success.Read(ctx, iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TCLIServiceRenewDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TRenewDelegationTokenResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil } func (p *TCLIServiceRenewDelegationTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin(ctx, "RenewDelegationToken_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if p != nil { - if err := p.writeField0(ctx, oprot); err != nil { - return err - } - } - if err := oprot.WriteFieldStop(ctx); err != nil { - return thrift.PrependError("write field stop error: ", err) - } - if err := oprot.WriteStructEnd(ctx); err != nil { - return thrift.PrependError("write struct stop error: ", err) - } - return nil + if err := oprot.WriteStructBegin(ctx, "RenewDelegationToken_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil } func (p *TCLIServiceRenewDelegationTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(ctx, oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(ctx); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err } func (p *TCLIServiceRenewDelegationTokenResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCLIServiceRenewDelegationTokenResult(%+v)", *p) + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceRenewDelegationTokenResult(%+v)", *p) } + +