Git Product home page Git Product logo

apiclient-go's People

Contributors

akvakh avatar alivox avatar dmitryivaneychik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

apiclient-go's Issues

Error while creating a new Client(config) // invalid memory address or nil pointer dereference

Does the following code works incorrect or am I doing something wrong?

        Config := config.NewConfig().WithKeyPath("key.json")

	Client, err := methods.NewClient(Config) // Error happens here. There were two differently
        // generated json keys by API request and admin panel, but the problem remains

	if err != nil {
		println(err.Error())
	}
	fromDate, toDate := &structure.Timestamp{}, &structure.Timestamp{}
	fromDate.UnmarshalJSON([]byte("2019-09-01 00:00:00"))
	toDate.UnmarshalJSON([]byte("2019-09-01 00:00:00"))

	Params := methods.GetCallHistoryParams{
		FromDate: fromDate,
		ToDate:   toDate,
	}

	result, verr, err := Client.History.GetCallHistory(Params)
	println(result.Count, verr.Error.Msg, err.Error())

Omitempty в булевых полях фильтра

Ребята, сделайте указателями булевые поля фильтра, например тут:

type GetPhoneNumbersParams struct {
	...
	IsBoundToApplication bool `json:"is_bound_to_application,string,omitempty"`
	Canceled bool `json:"canceled,string,omitempty"`
	Deactivated bool `json:"deactivated,string,omitempty"`
	AutoCharge bool `json:"auto_charge,string,omitempty"`
	ChildrenPhonesOnly bool `json:"children_phones_only,string,omitempty"`
	CanBeUsed bool `json:"can_be_used,string,omitempty"`
	SmsSupported bool `json:"sms_supported,string,omitempty"`
	IsBoundToRule bool `json:"is_bound_to_rule,string,omitempty"`
}

Из-за того, что сейчас булево поле не указатель и указан omitempty нельзя фильтровать результат по значению false:

filter := methods.GetPhoneNumbersParams{
	Canceled:     false,
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.