// Path: core/src/main/templates/com/contentful/vault/build/GeneratedBuildParameters.java
// public static final String PROJECT_VERSION = "${project.version}";


import com.contentful.java.cda.CDAClient;
import static com.contentful.vault.build.GeneratedBuildParameters.PROJECT_VERSION;
import static java.text.MessageFormat.format;
/*
 * Copyright (C) 2018 Contentful GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.contentful.vault;



public final class SyncConfig {
  private final CDAClient client;

  private final boolean invalidate;

  SyncConfig(Builder builder) {
    this.invalidate = builder.invalidate;

    if (builder.client == null) {
      if (builder.accessToken == null) {
        throw new IllegalStateException("Cannot create a CDA client with no access token. " +
            "Please set it.");
      }

      if (builder.spaceId == null) {
        throw new IllegalStateException("Cannot create a CDA client with no space id. " +
            "Please set it.");
      }

      this.client = CDAClient
          .builder()
          .setToken(builder.accessToken)
          .setSpace(builder.spaceId)
          .setEnvironment(builder.environment)
// Path: core/src/main/templates/com/contentful/vault/build/GeneratedBuildParameters.java
// public static final String PROJECT_VERSION = "${project.version}";


// Path: core/src/main/java/com/contentful/vault/SyncConfig.java
import com.contentful.java.cda.CDAClient;
import static com.contentful.vault.build.GeneratedBuildParameters.PROJECT_VERSION;
import static java.text.MessageFormat.format;

/*
 * Copyright (C) 2018 Contentful GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.contentful.vault;



public final class SyncConfig {
  private final CDAClient client;

  private final boolean invalidate;

  SyncConfig(Builder builder) {
    this.invalidate = builder.invalidate;

    if (builder.client == null) {
      if (builder.accessToken == null) {
        throw new IllegalStateException("Cannot create a CDA client with no access token. " +
            "Please set it.");
      }

      if (builder.spaceId == null) {
        throw new IllegalStateException("Cannot create a CDA client with no space id. " +
            "Please set it.");
      }

      this.client = CDAClient
          .builder()
          .setToken(builder.accessToken)
          .setSpace(builder.spaceId)
          .setEnvironment(builder.environment)
          .setIntegration("Vault", PROJECT_VERSION)