Skip to content

Commit

Permalink
liblab SDK update for version v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
riwanl8 committed Aug 21, 2024
1 parent 397d8f7 commit 02ef3f6
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 40 deletions.
30 changes: 18 additions & 12 deletions .manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"liblabVersion": "2.1.24",
"date": "2024-08-02T14:47:05.031Z",
"liblabVersion": "2.1.28",
"date": "2024-08-21T11:02:19.350Z",
"config": {
"language": "go",
"apiId": 947,
"sdkName": "signplus",
"sdkVersion": "2.0.0",
"sdkVersion": "1.0.0",
"liblabVersion": "2",
"deliveryMethods": ["zip"],
"languages": ["go"],
Expand All @@ -19,31 +19,35 @@
"githubRepoName": "signplus-sharp",
"ignoreFiles": [],
"liblabVersion": "2",
"sdkVersion": "2.0.0"
"sdkVersion": "1.0.0"
},
"go": {
"goModuleName": "github.com/alohihq/signplus-go",
"additionalConstructorParameters": [],
"githubRepoName": "signplus-go",
"ignoreFiles": [],
"liblabVersion": "2",
"sdkVersion": "2.0.0"
"sdkVersion": "1.0.0"
},
"java": {
"groupId": "alohi.signplus",
"additionalConstructorParameters": [],
"githubRepoName": "signplus-java",
"liblabVersion": "2",
"sdkVersion": "2.0.0"
"sdkVersion": "1.0.0"
},
"python": {
"alwaysInitializeOptionals": false,
"additionalConstructorParameters": [],
"pypiPackageName": "signplus-python",
"githubRepoName": "signplus-python",
"ignoreFiles": [],
"liblabVersion": "2",
"sdkVersion": "2.0.0"
"sdkVersion": "1.0.0"
},
"php": {
"packageName": "alohi/signplus",
"additionalConstructorParameters": [],
"githubRepoName": "signplus-php",
"ignoreFiles": [],
"liblabVersion": "2",
Expand All @@ -55,10 +59,11 @@
"httpClient": "axios",
"npmName": "signplus-typescript",
"npmOrg": "alohi",
"additionalConstructorParameters": [],
"githubRepoName": "signplus-typescript",
"ignoreFiles": [],
"liblabVersion": "2",
"sdkVersion": "2.0.0"
"sdkVersion": "1.0.0"
}
},
"publishing": {
Expand Down Expand Up @@ -92,9 +97,10 @@
"httpMethodsToRetry": ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]
},
"multiTenant": true,
"specUrl": "https://prod-liblab-api-stack-specs.s3.us-east-1.amazonaws.com/947/open-api-spec.yaml?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA5P3QKKDKGVNIJ2H7%2F20240802%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240802T144659Z&X-Amz-Expires=43200&X-Amz-Signature=d40852fad5b0585cd81c33b96446050f5962001285feb78369f2edb87450abf7&X-Amz-SignedHeaders=host&x-id=GetObject",
"specUrl": "https://prod-liblab-api-stack-specs.s3.us-east-1.amazonaws.com/947/open-api-spec.yaml?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA5P3QKKDKGVNIJ2H7%2F20240821%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240821T110214Z&X-Amz-Expires=43200&X-Amz-Signature=009d5622184bfe1c39e60a5d0a55af4a2e741c467ac7da365003bdd60373a218&X-Amz-SignedHeaders=host&x-id=GetObject",
"includeWatermark": false,
"goModuleName": "github.com/alohihq/signplus-go",
"additionalConstructorParameters": [],
"githubRepoName": "signplus-go",
"ignoreFiles": [],
"deliveryMethod": "zip",
Expand All @@ -108,7 +114,7 @@
"httpLibrary": {
"name": "axios",
"packages": {
"axios": "^1.6.8"
"axios": "^1.7.4"
},
"languages": ["typescript"]
},
Expand Down Expand Up @@ -192,8 +198,8 @@
"documentation/models/webhook.md",
"documentation/models/list_webhooks_request.md",
"documentation/models/list_webhooks_response.md",
"documentation/models/envelope_flow_type.md",
"documentation/models/envelope_legality_level.md",
"documentation/models/envelope_flow_type.md",
"documentation/models/envelope_status.md",
"documentation/models/signing_step.md",
"documentation/models/recipient.md",
Expand All @@ -218,8 +224,8 @@
"documentation/models/template_recipient_role.md",
"documentation/models/template_order_field.md",
"documentation/models/webhook_event.md",
"pkg/signplus/envelope_flow_type.go",
"pkg/signplus/envelope_legality_level.go",
"pkg/signplus/envelope_flow_type.go",
"pkg/signplus/envelope_status.go",
"pkg/signplus/recipient_role.go",
"pkg/signplus/recipient_verification_type.go",
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Signplus Go SDK 2.0.0
# Signplus Go SDK 1.0.0

Welcome to the Signplus SDK documentation. This guide will help you get started with integrating and using the Signplus SDK in your project.

## Versions

- API version: `2.0.0`
- SDK version: `2.0.0`
- SDK version: `1.0.0`

## About the API

Expand Down Expand Up @@ -46,7 +46,7 @@ import (
"github.com/alohihq/signplus-go/pkg/signplusconfig"
)

config := signplusconfig.NewConfig{}
config := signplusconfig.NewConfig()
config.SetBearerToken("YOUR-TOKEN")

sdk := signplus.NewSignplus(config)
Expand All @@ -60,7 +60,7 @@ import (
"github.com/alohihq/signplus-go/pkg/signplusconfig"
)

config := signplusconfig.NewConfig{}
config := signplusconfig.NewConfig()

sdk := signplus.NewSignplus(config)
sdk.SetBearerToken("YOUR-TOKEN")
Expand Down Expand Up @@ -121,8 +121,8 @@ The SDK includes several models that represent the data structures used in API r
| [Webhook](documentation/models/webhook.md) | |
| [ListWebhooksRequest](documentation/models/list_webhooks_request.md) | |
| [ListWebhooksResponse](documentation/models/list_webhooks_response.md) | |
| [EnvelopeFlowType](documentation/models/envelope_flow_type.md) | Flow type of the envelope (REQUEST_SIGNATURE is a request for signature, SIGN_MYSELF is a self-signing flow) |
| [EnvelopeLegalityLevel](documentation/models/envelope_legality_level.md) | Legal level of the envelope (SES is Simple Electronic Signature, QES_EIDAS is Qualified Electronic Signature, QES_ZERTES is Qualified Electronic Signature with Zertes) |
| [EnvelopeFlowType](documentation/models/envelope_flow_type.md) | Flow type of the envelope (REQUEST_SIGNATURE is a request for signature, SIGN_MYSELF is a self-signing flow) |
| [EnvelopeStatus](documentation/models/envelope_status.md) | Status of the envelope |
| [SigningStep](documentation/models/signing_step.md) | |
| [Recipient](documentation/models/recipient.md) | |
Expand Down
3 changes: 0 additions & 3 deletions cmd/examples/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ func main() {
config := signplusconfig.NewConfig()
client := signplus.NewSignplus(config)

envelopeFlowType := signplus.ENVELOPE_FLOW_TYPE_REQUEST_SIGNATURE

envelopeLegalityLevel := signplus.ENVELOPE_LEGALITY_LEVEL_SES

request := signplus.CreateEnvelopeRequest{}
request.SetName("Name")
request.SetFlowType(envelopeFlowType)
request.SetLegalityLevel(envelopeLegalityLevel)

response, err := client.Signplus.CreateEnvelope(context.Background(), request)
Expand Down
1 change: 0 additions & 1 deletion documentation/models/create_envelope_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
| Name | Type | Required | Description |
| :------------ | :----------------------------- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name | string || Name of the envelope |
| FlowType | signplus.EnvelopeFlowType || Flow type of the envelope (REQUEST_SIGNATURE is a request for signature, SIGN_MYSELF is a self-signing flow) |
| LegalityLevel | signplus.EnvelopeLegalityLevel || Legal level of the envelope (SES is Simple Electronic Signature, QES_EIDAS is Qualified Electronic Signature, QES_ZERTES is Qualified Electronic Signature with Zertes) |
| ExpiresAt | int64 || Unix timestamp of the expiration date |
| Comment | string || Comment for the envelope |
Expand Down
3 changes: 0 additions & 3 deletions documentation/services/signplus_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,10 @@ import (
config := signplusconfig.NewConfig()
client := signplus.NewSignplus(config)

envelopeFlowType := signplus.ENVELOPE_FLOW_TYPE_REQUEST_SIGNATURE

envelopeLegalityLevel := signplus.ENVELOPE_LEGALITY_LEVEL_SES

request := signplus.CreateEnvelopeRequest{}
request.SetName("Name")
request.SetFlowType(envelopeFlowType)
request.SetLegalityLevel(envelopeLegalityLevel)

response, err := client.Signplus.CreateEnvelope(context.Background(), request)
Expand Down
13 changes: 10 additions & 3 deletions internal/validation/validate_pattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,21 @@ func validatePattern(field reflect.StructField, value reflect.Value) error {
return fmt.Errorf("regex failed to compile")
}

kind := utils.GetReflectKind(value.Type())
if value.IsNil() {
return nil
}

kind := utils.GetReflectKind(value.Type())
if kind != reflect.String {
return fmt.Errorf("field %s with value %v cannot match pattern %s because it is not a string", field.Name, value, pattern)
}

if !compiledRegex.MatchString(value.String()) {
return fmt.Errorf("field %s with value %v does not match pattern %s", field.Name, value, pattern)
if value.Kind() == reflect.Ptr && !compiledRegex.MatchString(value.Elem().String()) {
return fmt.Errorf("field %s with value %v does not match pattern %s", field.Name, value.Elem().String(), pattern)
}

if value.Kind() != reflect.Ptr && !compiledRegex.MatchString(value.String()) {
return fmt.Errorf("field %s with value %v does not match pattern %s", field.Name, value.String(), pattern)
}

return nil
Expand Down
13 changes: 0 additions & 13 deletions pkg/signplus/create_envelope_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package signplus
type CreateEnvelopeRequest struct {
// Name of the envelope
Name *string `json:"name,omitempty" required:"true"`
// Flow type of the envelope (REQUEST_SIGNATURE is a request for signature, SIGN_MYSELF is a self-signing flow)
FlowType *EnvelopeFlowType `json:"flow_type,omitempty" required:"true"`
// Legal level of the envelope (SES is Simple Electronic Signature, QES_EIDAS is Qualified Electronic Signature, QES_ZERTES is Qualified Electronic Signature with Zertes)
LegalityLevel *EnvelopeLegalityLevel `json:"legality_level,omitempty" required:"true"`
// Unix timestamp of the expiration date
Expand All @@ -26,17 +24,6 @@ func (c *CreateEnvelopeRequest) GetName() *string {
return c.Name
}

func (c *CreateEnvelopeRequest) SetFlowType(flowType EnvelopeFlowType) {
c.FlowType = &flowType
}

func (c *CreateEnvelopeRequest) GetFlowType() *EnvelopeFlowType {
if c == nil {
return nil
}
return c.FlowType
}

func (c *CreateEnvelopeRequest) SetLegalityLevel(legalityLevel EnvelopeLegalityLevel) {
c.LegalityLevel = &legalityLevel
}
Expand Down

0 comments on commit 02ef3f6

Please sign in to comment.