diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d450b7..03b1b0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## [4.1.1](https://github.com/plivo/plivo-go/tree/v4.1.1) (2019-11-05) +- Add SSML support + ## [4.1.0](https://github.com/plivo/plivo-go/tree/v4.1.0) (2019-03-12) - Add PHLO support - Add Multi-party call triggers diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..63bcff1 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,7 @@ +#!groovy + +@Library('plivo_standard_libs@sdks') _ + +sdksPipeline ([ + buildContainer: 'plivo/jenkins-ci/debian:stretch' +]) diff --git a/baseclient.go b/baseclient.go index 753b6f3..145c80a 100644 --- a/baseclient.go +++ b/baseclient.go @@ -5,14 +5,15 @@ import ( "encoding/json" "errors" "fmt" - "github.com/google/go-querystring/query" "io/ioutil" "net/http" "net/url" "reflect" + + "github.com/google/go-querystring/query" ) -const sdkVersion = "4.1.0" +const sdkVersion = "4.1.1" type ClientOptions struct { HttpClient *http.Client @@ -31,8 +32,8 @@ type BaseClient struct { ResponseInterceptor func(response *http.Response) } -func (client *BaseClient) NewRequest(method string, params interface{}, baseRequestString string, formatString string, -formatParams ...interface{}) (request *http.Request, err error) { +func (client *BaseClient) NewRequest(method string, params interface{}, baseRequestString string, formatString string, + formatParams ...interface{}) (request *http.Request, err error) { if client == nil || client.httpClient == nil { err = errors.New("client and httpClient cannot be nil") @@ -58,11 +59,11 @@ formatParams ...interface{}) (request *http.Request, err error) { requestUrl.RawQuery = values.Encode() } else { - if(reflect.ValueOf(params).Kind().String() != "map"){ + if reflect.ValueOf(params).Kind().String() != "map" { if err = json.NewEncoder(buffer).Encode(params); err != nil { return } - }else if (reflect.ValueOf(params).Kind().String() == "map" && !reflect.ValueOf(params).IsNil()) { + } else if reflect.ValueOf(params).Kind().String() == "map" && !reflect.ValueOf(params).IsNil() { if err = json.NewEncoder(buffer).Encode(params); err != nil { return } @@ -89,7 +90,6 @@ func (client *BaseClient) ExecuteRequest(request *http.Request, body interface{} return errors.New("httpClient cannot be nil") } - response, err := client.httpClient.Do(request) if err != nil { return @@ -102,9 +102,9 @@ func (client *BaseClient) ExecuteRequest(request *http.Request, body interface{} err = json.Unmarshal(data, body) } } else { - if (string(data) == "{}" && response.StatusCode == 404){ + if string(data) == "{}" && response.StatusCode == 404 { err = errors.New(string("Resource not found exception \n" + response.Status)) - }else{ + } else { err = errors.New(string(data)) } } diff --git a/ci/config.yml b/ci/config.yml new file mode 100644 index 0000000..fc7aa2a --- /dev/null +++ b/ci/config.yml @@ -0,0 +1,4 @@ +--- +parent: central +serviceName: plivo-go +language: go-sdk