4namespace Bitrix\Calendar\Sync\Google;
8use Bitrix\Fileman\UserField\Types\AddressType;
9use Bitrix\Main\Config\Option;
25 public const GOOGLE_SERVER_PATH_V3 = self::HTTP_SCHEME_DEFAULT . self::HTTP_SCHEME_SEPARATOR . self::GOOGLE_API_URL . self::GOOGLE_API_V3_URI;
26 public const GOOGLE_SERVER_PATH_V2 = self::HTTP_SCHEME_DEFAULT . self::HTTP_SCHEME_SEPARATOR . self::GOOGLE_CALDAV_URL . self::GOOGLE_API_V2_URI;
43 return in_array($accountType, [self::GOOGLE_ACCOUNT_TYPE_CALDAV, self::GOOGLE_ACCOUNT_TYPE_API],
true);
48 return !empty($errorText) && preg_match(
"/^(\[410\] Resource has been deleted)/i", $errorText);
53 return !empty($errorText) && preg_match(
"/^\[(404)\][a-z0-9 _]*/i", $errorText);
58 return !empty($errorText)
59 && (preg_match(
"/^(\[410\] The requested minimum modification time lies too far in the past.)/i", $errorText)
60 || preg_match(
"/^(\[410\] Sync token is no longer valid, a full sync is required.)/i", $errorText))
66 return !empty($errorText)
67 && (preg_match(
"/^\[401\] Request is missing required authentication credential.[a-z0-9 _]*/i", $errorText)
68 || preg_match(
"/^\[401\] Request had invalid authentication credentials.[a-z0-9 _]*/i", $errorText))
82 Loader::includeModule(
'socialservices')
83 && ($apiKey = Option::get(
'socialservices',
'google_api_key',
null))
89 if (Loader::includeModule(
'fileman'))
98 return Option::get(
'fileman',
'google_map_api_key',
null)
99 ?? Option::get(
'bitrix24',
'google_map_api_key',
null)
isMissingRequiredAuthCredential(string $errorText=null)
isNotValidSyncTokenError(string $errorText=null)
const GOOGLE_SERVER_PATH_V2
const GOOGLE_ACCOUNT_TYPE_API
const GOOGLE_ACCOUNT_TYPE_CALDAV
const EXCLUDED_DATE_FORMAT
const GOOGLE_SERVER_PATH_V3
const DATE_TIME_FORMAT_WITH_UTC_TIMEZONE
isNotFoundError(string $errorText=null)
const EXCLUDED_DATE_TIME_FORMAT
const DATE_TIME_FORMAT_WITH_MICROSECONDS
isGoogleConnection($accountType)
isDeletedResource($errorText)
const DATE_TIME_FORMAT_RFC_3339
const HTTP_SCHEME_DEFAULT
const HTTP_SCHEME_SEPARATOR