doctolib

package
v0.0.0-...-0cff2ed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

* MIT License * * Copyright (c) 2021 Guillaume Truchot * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE.

Index

Constants

View Source
const RootUrl = "https://doctolib.fr"

Variables

This section is empty.

Functions

This section is empty.

Types

type AvailabilitiesResponse

type AvailabilitiesResponse struct {
	Availabilities []availability `json:"availabilities"`
	Total          int            `json:"total"`
	CsrfToken      string
}

type BookingAgenda

type BookingAgenda struct {
	Id                       int   `json:"id"`
	BookingDisabled          bool  `json:"booking_disabled"`
	BookingTemporaryDisabled bool  `json:"booking_temporary_disabled"`
	VisitMotiveIds           []int `json:"visit_motive_ids"`
	PracticeId               int   `json:"practice_id"`
}

type BookingProfile

type BookingProfile struct {
	Id int `json:"id"`
}

type BookingResponse

type BookingResponse struct {
	Data      BookingResponseData `json:"data"`
	CsrfToken string
}

type BookingResponseData

type BookingResponseData struct {
	Profile      BookingProfile       `json:"profile"`
	VisitMotives []BookingVisitMotive `json:"visit_motives"`
	Agendas      []BookingAgenda      `json:"agendas"`
}

type BookingVisitMotive

type BookingVisitMotive struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(requestsTimeout time.Duration) (*Client, error)

func (*Client) ConfirmAppointment

func (c *Client) ConfirmAppointment(appointmentId string, startDatetime string, masterPatient MasterPatient,
	csrfToken string) (*ConfirmAppointmentResponse, error)

func (*Client) CreateAppointment

func (c *Client) CreateAppointment(startDatetime string, secondSlotDatetime string, visitMotiveIds []int,
	agendaIds []int, practiceIds []int, profileId int, csrfToken string) (*CreateAppointmentResponse, error)

func (*Client) GetAvailabilities

func (c *Client) GetAvailabilities(startDate time.Time, firstSlotDatetime *time.Time, visitMotiveIds []int,
	agendaIds []int, practiceIds []int, limit int, csrfToken string) (*AvailabilitiesResponse, error)

func (*Client) GetBooking

func (c *Client) GetBooking(placeName string, csrfToken string) (*BookingResponse, error)

func (*Client) GetMasterPatients

func (c *Client) GetMasterPatients(csrfToken string) (*MasterPatientsResponse, error)

func (*Client) Login

func (c *Client) Login(username string, password string) (*LoginResponse, error)

type ConfirmAppointmentResponse

type ConfirmAppointmentResponse struct {
	CsrfToken string
}

type CreateAppointmentResponse

type CreateAppointmentResponse struct {
	Id        string `json:"id"`
	CsrfToken string
}

type LoginResponse

type LoginResponse struct {
	Id        int    `json:"id"`
	FullName  string `json:"full_name"`
	CsrfToken string
}

type MasterPatient

type MasterPatient struct {
	Id                int    `json:"id"`
	FirstName         string `json:"first_name"`
	LastName          string `json:"last_name"`
	Kind              string `json:"kind"`
	Gender            bool   `json:"gender"`
	Birthdate         string `json:"birthdate"`
	IsComplete        bool   `json:"is_complete"`
	HasOwnEmail       bool   `json:"has_own_email"`
	HasOwnPhoneNumber bool   `json:"has_own_phone_number"`
	Email             string `json:"email"`
	PhoneNumber       string `json:"phone_number"`
	MismatchInsurance bool   `json:"mismatchInsurance"`
	Consented         bool   `json:"consented"`
}

type MasterPatientsResponse

type MasterPatientsResponse struct {
	MasterPatients []MasterPatient
	CsrfToken      string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL