test: Fix indentation
[libisds.git] / test / simline / services.h
blobe1b09e3f96d84395d7f4635ca303c022986962fd
1 #ifndef __ISDS_SERVICES_H
2 #define __ISDS_SERVICES_H
4 #include <time.h> /* struct tm */
5 #include <sys/time.h> /* struct timeval */
6 #include "server_types.h"
8 typedef enum {
9 SERVICE_END,
10 SERVICE_asws_changePassword_ChangePasswordOTP,
11 SERVICE_asws_changePassword_SendSMSCode,
12 SERVICE_DS_df_DataBoxCreditInfo,
13 SERVICE_DS_df_ISDSSearch2,
14 SERVICE_DS_DsManage_ChangeISDSPassword,
15 SERVICE_DS_Dx_EraseMessage,
16 SERVICE_DS_Dz_DummyOperation,
17 SERVICE_DS_Dz_ResignISDSDocument,
18 } service_id;
20 struct service_configuration {
21 service_id name; /* Identifier of SOAP service */
22 const void *arguments; /* Configuration for the service */
25 /* Type of credit change event */
26 typedef enum {
27 SERVER_CREDIT_CHARGED, /* Credit has been charged */
28 SERVER_CREDIT_DISCHARGED, /* Credit has been discharged */
29 SERVER_CREDIT_MESSAGE_SENT, /* Credit has been spent for sending
30 a commerical message */
31 SERVER_CREDIT_STORAGE_SET, /* Credit has been spent for setting
32 a long-term storage */
33 SERVER_CREDIT_EXPIRED /* Credit has expired */
34 } server_credit_event_type;
36 /* Data specific for SERVER_CREDIT_CHARGED server_credit_event_type */
37 struct server_credit_event_charged {
38 char *transaction; /* Transaction identified;
39 NULL-terminated string. */
42 /* Data specific for SERVER_CREDIT_DISCHARGED server_credit_event_type */
43 struct server_credit_event_discharged {
44 char *transaction; /* Transaction identified;
45 NULL-terminated string. */
48 /* Data specific for SERVER_CREDIT_MESSAGE_SENT server_credit_event_type */
49 struct server_credit_event_message_sent {
50 char *recipient; /* Recipent's box ID of the sent message */
51 char *message_id; /* ID of the sent message */
54 /* Data specific for SERVER_CREDIT_STORAGE_SET server_credit_event_type */
55 struct server_credit_event_storage_set {
56 long int new_capacity; /* New storage capacity. The unit is
57 a message. */
58 struct tm *new_valid_from; /* The new capacity is available since
59 date. */
60 struct tm *new_valid_to; /* The new capacity expires on date. */
61 long int *old_capacity; /* Previous storage capacity; Optional.
62 The unit is a message. */
63 struct tm *old_valid_from; /* Date; Optional; Only tm_year,
64 tm_mon, and tm_mday carry sane value. */
65 struct tm *old_valid_to; /* Date; Optional. */
66 char *initiator; /* Name of a user who initiated this
67 change; Optional. */
70 /* Event about change of credit for sending commerical services */
71 struct server_credit_event {
72 /* Common fields */
73 struct timeval *time; /* When the credit was changed. */
74 long int credit_change; /* Difference in credit value caused by
75 this event. The unit is 1/100 CZK. */
76 long int new_credit; /* Credit value after this event.
77 The unit is 1/100 CZK. */
78 server_credit_event_type type; /* Type of the event */
80 /* Datails specific for the type */
81 union {
82 struct server_credit_event_charged charged;
83 /* SERVER_CREDIT_CHARGED */
84 struct server_credit_event_discharged discharged;
85 /* SERVER_CREDIT_DISCHAGED */
86 struct server_credit_event_message_sent message_sent;
87 /* SERVER_CREDIT_MESSAGE_SENT */
88 struct server_credit_event_storage_set storage_set;
89 /* SERVER_CREDIT_STORAGE_SET */
90 } details;
93 /* An ISDSSearch2 result */
94 struct server_db_result {
95 char *id; /* dbID value */
96 char *type; /* dbType value */
97 char *name; /* dbName value */
98 char *address; /* dbAddress value */
99 struct tm *birth_date; /* dbBiDate value */
100 char *ic; /* dbICO value */
101 _Bool ovm; /* dbEffectiveOVM value */
102 char *send_options; /* dbSendOptions value */
105 /* General linked list */
106 struct server_list {
107 struct server_list *next; /* Next list item,
108 or NULL if current is last */
109 void *data; /* Payload */
110 void (*destructor) (void **); /* Payload deallocator;
111 Use NULL to have static data member. */
114 struct arguments_DS_df_DataBoxCreditInfo {
115 const char *status_code;
116 const char *status_message;
117 const char *box_id; /* Require this dbID in request */
118 const struct tm *from_date; /* Require this ciFromDate in request */
119 const struct tm *to_date; /* Require this ciTodate in request */
120 const long int current_credit; /* Return this currentCredit */
121 const char *email; /* Return this notifEmail */
122 const struct server_list *history; /* Return this ciRecords */
125 struct arguments_DS_df_ISDSSearch2 {
126 const char *status_code;
127 const char *status_message;
128 const char *search_text; /* Require this searchText in a request */
129 const char *search_type; /* Require this searchType in a request */
130 const char *search_scope; /* Require this searchScope in a request */
131 const long int *search_page_number; /* Require this page in a request */
132 const long int *search_page_size; /* Require this pageSize in a request */
133 const _Bool *search_highlighting_value; /* Require this highlighting
134 value in a request */
135 const unsigned long int *total_count; /* Return this totalCount */
136 const unsigned long int *current_count; /* Return this currentCount */
137 const unsigned long int *position; /* Return this position */
138 const _Bool *last_page; /* Return this lastPage */
139 const _Bool results_exists; /* Return dbResults element */
140 const struct server_list *results; /* Return list of
141 struct server_db_result* as dbResults */
144 struct arguments_DS_Dz_ResignISDSDocument {
145 const char *status_code;
146 const char *status_message;
147 const struct tm *valid_to; /* Return this date if not NULL */
150 struct arguments_DS_Dx_EraseMessage {
151 const char *message_id; /* Expected message ID */
152 _Bool incoming; /* Expected message direction,
153 true for incoming */
156 struct arguments_DS_DsManage_ChangeISDSPassword {
157 const char *username; /* User ID */
158 const char *current_password; /* User password */
161 struct arguments_asws_changePassword_ChangePasswordOTP {
162 const char *username; /* User ID */
163 const char *current_password; /* User password */
164 enum auth_otp_method method; /* OTP method */
165 const char *reference_number; /* Return this string if not NULL */
168 struct arguments_asws_changePassword_SendSMSCode {
169 const char *status_code;
170 const char *status_message;
171 const char *reference_number; /* Return this string if not NULL */
174 #endif